Bug #72412 [NEW]: PharData for archive containing "relative current directory" ( ./ )
| From: | raphael dot droz at gmail dot com | Date: | Wed, 15 Jun 2016 13:24:03 +0000 |
| Subject: | Bug #72412 [NEW]: PharData for archive containing "relative current directory" ( ./ ) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-201650@lists.php.net to get a copy of this message | ||
From: raphael dot droz at gmail dot com
Operating system: Linux
PHP version: 5.6.22
Package: PHAR related
Bug Type: Bug
Bug description:PharData for archive containing "relative current directory" ( ./ )
Description:
------------
When creating a tar archive containing .
Phar seems unable to extract it.
Extracting ./file1 would work, but listing or extracting the whole
archive does not seem possible and fail with a Fatal internal error.
This is especially annoying if you don't know in advance the name of the
file to extract: in such case the archive is simply unsuitable for
Phar.
As seen on IRC, it (july 14th), it does not affect every PHP version.
Maybe related to bug #64884 since some symptoms seem common.
Test script:
---------------
mkdir -p test1;
echo "This is a test file" > test1/file1;
tar czf test1.tar.gz -C test1 .
php -r '$p = new PharData("/tmp/test1.tar.gz");
$p->extractTo("test2");'
cat test2/file1
Expected result:
----------------
This is a test file
Actual result:
--------------
Extraction from phar "/tmp/test1.tar.gz" failed: Cannot extract ".",
internal error in Command line code on line 1
# Note that the "test1" directory is created, but empty
--
Edit bug report at https://bugs.php.net/bug.php?id=72412&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72412&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72412&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72412&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72412&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72412&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72412&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72412&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72412&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72412&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72412&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72412&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72412&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72412&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72412&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72412&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72412&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72412&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72412&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72412&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72412&r=mysqlcfg