diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-07-26 02:54:42 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-07-26 02:54:42 +0000 |
commit | c6ae412b294af5529ca02501331a3352128fa173 (patch) | |
tree | 19c188bcc8e6cb2fa7f037365230a663da2ec971 /lib/libarchive/archive_private.h | |
parent | ec34d4330fc3137407640bc672d19416d492f62a (diff) | |
download | FreeBSD-src-c6ae412b294af5529ca02501331a3352128fa173.zip FreeBSD-src-c6ae412b294af5529ca02501331a3352128fa173.tar.gz |
When writing "pax" format, readers are supposed to ignore fields
in the regular ustar header that are overridden by the pax
extended attributes. As a result, it makes perfect sense to
use numeric extensions in the regular ustar header so that readers
that don't understand pax extensions but do understand some other
extensions can still get useful information out of it.
This is especially important for filesizes, as the failure to
read a file size correctly can get the reader out of sync.
This commit introduces a "non-strict" option into the internal
function to format a ustar header. In non-strict mode, the formatter
will use longer octal values (overwriting terminators) or binary
("base-256") values as needed to ensure that large file sizes,
negative mtimes, etc, have the correct values stored in the regular
ustar header.
Diffstat (limited to 'lib/libarchive/archive_private.h')
-rw-r--r-- | lib/libarchive/archive_private.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libarchive/archive_private.h b/lib/libarchive/archive_private.h index 730974c..5fb4d9b 100644 --- a/lib/libarchive/archive_private.h +++ b/lib/libarchive/archive_private.h @@ -198,10 +198,15 @@ struct archive { }; -/* Utility function to format a USTAR header into a buffer. */ +/* + * Utility function to format a USTAR header into a buffer. If + * "strict" is set, this tries to create the absolutely most portable + * version of a ustar header. If "strict" is set to 0, then it will + * relax certain requirements. + */ int __archive_write_format_header_ustar(struct archive *, char buff[512], - struct archive_entry *, int tartype); + struct archive_entry *, int tartype, int strict); #define ARCHIVE_STATE_ANY 0xFFFFU #define ARCHIVE_STATE_NEW 1U |