diff options
author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
---|---|---|
committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
commit | 61fac2242c77a75b588a0a6f71b0f75c5d4d1fdc (patch) | |
tree | f0f5a81c35118c56a6a3ac1a5d72fd50e2cdf842 /lib/libarchive/archive_write_set_format_pax.c | |
parent | e99eef3d4f1f4ae5d70a648d96c922d47dd98907 (diff) |
Update file flag handling.
The new fflags support in archive_entry supports Linux and FreeBSD
file flags and is a bit more gracious about unrecognized flag names
than strtofflags(3). This involves some minor API breakage.
The default tar format ("restricted pax") now enables pax extensions
when archiving files that have flags. In particular, copying dir
heirarchies with 'bsdtar cf - -C src . | bsdtar xpf - -C dest' now
preserves file flags. (Note the "p" on extract!)
While I'm here, fill in some additional explanation in the
archive_entry.3 manpage, fill in some missing MLINKS, mark some
overlooked internal functions 'static', and make a few minor style
fixes.
Notes
Notes:
svn path=/head/; revision=128669
Diffstat (limited to 'lib/libarchive/archive_write_set_format_pax.c')
-rw-r--r-- | lib/libarchive/archive_write_set_format_pax.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c index 19317df0380d..950cd4d2d27a 100644 --- a/lib/libarchive/archive_write_set_format_pax.c +++ b/lib/libarchive/archive_write_set_format_pax.c @@ -493,6 +493,12 @@ archive_write_pax_header(struct archive *a, ((st_main->st_mtime < 0) || (st_main->st_mtime >= 0x7fffffff))) need_extension = 1; + /* I use a star-compatible file flag attribute. */ + p = archive_entry_fflags_text(entry_main); + if (!need_extension && p != NULL && *p != '\0') + need_extension = 1; + + /* If there are non-trivial ACL entries, we need an extension. */ if (!need_extension && archive_entry_acl_count(entry_original, ARCHIVE_ENTRY_ACL_TYPE_ACCESS) > 0) @@ -533,7 +539,7 @@ archive_write_pax_header(struct archive *a, ARCHIVE_STAT_ATIME_NANOS(st_main)); /* I use a star-compatible file flag attribute. */ - p = archive_entry_fflags(entry_main); + p = archive_entry_fflags_text(entry_main); if (p != NULL && *p != '\0') add_pax_attr(&(pax->pax_header), "SCHILY.fflags", p); |