]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add more explanation comments to validate_number_field()
authorMartin Matuska <martin@matuska.org>
Mon, 5 Dec 2016 15:24:54 +0000 (16:24 +0100)
committerMartin Matuska <martin@matuska.org>
Mon, 5 Dec 2016 15:27:58 +0000 (16:27 +0100)
libarchive/archive_read_support_format_tar.c

index b3db34d78bbd466a7d6680432abf08b758cd60b6..6febc2dd28b45b945693bad4c0689b605f7c9a9d 100644 (file)
@@ -299,14 +299,21 @@ archive_read_format_tar_cleanup(struct archive_read *a)
  *
  * This has to be pretty lenient in order to accomodate the enormous
  * variety of tar writers in the world:
- *  = POSIX ustar requires octal values with leading zeros and
- *    specific termination on fields
+ *  = POSIX (IEEE Std 1003.1-1988) ustar requires octal values with leading
+ *    zeros and allows fields to be terminated with space or null characters
  *  = Many writers use different termination (in particular, libarchive
  *    omits terminator bytes to squeeze one or two more digits)
  *  = Many writers pad with space and omit leading zeros
  *  = GNU tar and star write base-256 values if numbers are too
  *    big to be represented in octal
  *
+ *  Examples of specific tar headers that we should support:
+ *  = Perl Archive::Tar terminates uid, gid, devminor and devmajor with two
+ *    null bytes, pads size with spaces and other numeric fields with zeroes
+ *  = plexus-archiver prior to 2.6.3 (before switching to commons-compress)
+ *    may have uid and gid fields filled with spaces without any octal digits
+ *    at all and pads all numeric fields with spaces
+ *
  * This should tolerate all variants in use.  It will reject a field
  * where the writer just left garbage after a trailing NUL.
  */