]> granicus.if.org Git - php/commit
Fix #75102: `PharData` says invalid checksum for valid tar
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 2 Dec 2020 13:49:43 +0000 (14:49 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 4 Dec 2020 12:02:29 +0000 (13:02 +0100)
commit8588ae72156eeead928a8fe93bb8a5ab293f1e89
tree54144ab47f21410d3ac86b19d52ce638661ffaab
parent8f8e6f95af219bc2e10d52c34016bc993c8419ef
Fix #75102: `PharData` says invalid checksum for valid tar

Apparently, there are broken tarballs out there which are actually in
ustar format, but did not write the `ustar` marker.  Since popular tar
tools like GNU tar and 7zip have no issues dealing with such tarballs,
Phar should also be more resilient.

Thus, when the first checksum check of a tarball in (presumed) in old-
style format fails, we check whether the checksum would be suitable for
ustar format; if so, we treat the tarball as being in ustar format.

Closes GH-6479.
NEWS
ext/phar/tar.c
ext/phar/tests/bug75102.phpt [new file with mode: 0644]
ext/phar/tests/bug75102.tar [new file with mode: 0644]