extractTo fails for tarball created by BSD tar
| Bug #64343 | PharData::extractTo fails for tarball created by BSD tar | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2013-03-03 19:52 UTC | Modified: | 2015-03-30 11:51 UTC |
|
||||||||||
| From: | njh at aelius dot com | Assigned: | mike (profile) | |||||||||||
| Status: | Closed | Package: | PHAR related | |||||||||||
| PHP Version: | 5.4.12 | OS: | Mac OS 10.7.5 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2013-03-03 19:52 UTC] njh at aelius dot com
Description: ------------ The extractTo() method in Phar doesn't seem to work with tar archives generated using the BSD version of the tar tool, which is the version that comes pre- installed on Mac OS X. I have uploaded two sample tar files, which both contain a single test.txt file: http://www.aelius.com/njh/tmp/tartest/test-bsd.tar.gz http://www.aelius.com/njh/tmp/tartest/test-gnu.tar.gz When run the GNU generated tar file works correctly but the BSD generated tar file fails. This problem came up with trying to install dependencies using composer, that had been generated using BSD tar on Mac OS X: https://github.com/composer/composer/issues/1492 Test script: --------------- <?php $phar = new PharData('test-gnu.tar.gz'); $phar->extractTo('extracted-gnu'); $phar = new PharData('test-bsd.tar.gz'); $phar->extractTo('extracted-bsd'); Expected result: ---------------- Both the test-bsd.tar.gz and test-gnu.tar.gz should extract the test.txt file. Actual result: -------------- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'phar error: "/tmp/tartest/test-bsd.tar.gz" is a corrupted tar file (checksum mismatch of file "18 uid=1451698731 20 ctime=1362335175 20 atime=1362335267 24 SCHILY.dev=234881029 23 SCHILY.ino=1224")' in /tmp/tartest/test.php:5 Stack trace: #0 /tmp/tartest/test.php(5): PharData->__construct('test-bsd.tar.gz') #1 {main} thrown in /tmp/tartest/test.php on line 5
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2013-03-05 16:53 UTC] ralphschindler@php.net
[2013-03-08 11:10 UTC] njh at aelius dot com
[2013-03-08 11:24 UTC] njh at aelius dot com
[2015-03-29 07:08 UTC] mike@php.net
-Assigned To: ralphschindler +Assigned To: mike
[2015-03-29 07:08 UTC] mike@php.net
[2015-03-30 11:51 UTC] mike@php.net
-Status: Assigned +Status: Closed
[2015-03-30 11:51 UTC] mike@php.net