diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
commit | 736725bcabf6c72ac5bfda301f3aa3b447ac4c6b (patch) | |
tree | f0f5a81c35118c56a6a3ac1a5d72fd50e2cdf842 /lib/libarchive/archive_write_set_format_pax.c | |
parent | f5f7c88a25b2bbf11fbacb20c1194ad48018294b (diff) | |
download | FreeBSD-src-736725bcabf6c72ac5bfda301f3aa3b447ac4c6b.zip FreeBSD-src-736725bcabf6c72ac5bfda301f3aa3b447ac4c6b.tar.gz |
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.
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 19317df..950cd4d 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); |