Added more forgiving CRC checking logic when reading tar files
commite44cab4de65b5a6dbeb23f3f8b947b6b4117f628
authorChris Frey <cdfrey@foursquare.net>
Tue, 31 Jul 2012 21:12:36 +0000 (31 17:12 -0400)
committerChris Frey <cdfrey@foursquare.net>
Tue, 31 Jul 2012 21:12:36 +0000 (31 17:12 -0400)
tree760e4883649ca2f801a46883c4215ba4f55a7134
parentacd507bfd1477cf28d6e82e8c4604cb406ecc754
Added more forgiving CRC checking logic when reading tar files

Tim Kientzle posted the following to the libtar mailing list regarding
the earlier CRC bug:

This exact bug has reappeared many times in different
tar implementations.  Here are two suggestions:

* The standards specify that the checksum is
calculated using unsigned characters.

* The most robust tar readers will compute the
checksum both ways (with unsigned characters and
with signed characters) and accept the header
if either version matches.

https://lists.feep.net:8080/pipermail/libtar/2012-July/000327.html

He gave the following links:

http://pubs.opengroup.org/onlinepubs/9699919799/

"pax" is under "Shell & Utilities" => "Utilities"; here's
a direct link:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
https://github.com/libarchive/libarchive/wiki/ManPageTar5

This commit turns libtar into a "more robust tar reader."
lib/libtar.h
lib/util.c