From:             njh at aelius dot com
Operating system: Mac OS 10.7.5
PHP version:      5.4.12
Package:          PHAR related
Bug Type:         Bug
Bug description:PharData::extractTo fails for tarball created by BSD tar

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


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64343&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64343&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64343&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64343&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64343&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64343&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64343&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64343&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64343&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64343&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64343&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64343&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64343&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64343&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64343&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64343&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64343&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64343&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64343&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64343&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64343&r=mysqlcfg

Reply via email to