Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.11

Bug #19330 Class creates incorrect (non-readable) tar.gz file
Submitted: 2012-03-12 11:31 UTC Modified: 2012-04-05 09:48 UTC
From: schmale Assigned: mrook
Status: Closed Package: Archive_Tar (version 1.3.9)
PHP Version: 5.3.6 OS: Ubuntu
Roadmaps: 1.3.10    
Subscription  


 [2012-03-12 11:31 UTC] schmale (Alexander Schmale)
Description: ------------ Under specific circumstances, the class produces an invalid tar.gz file: 1) A specific file has to be included (see attachment). I tried other files, but only with this file did the error occur. 2) The file must NOT be the only file in its directory 3) A second directory has to be added (directory can be empty). Important is, that the second directory is added via a separate add/addModify call, the two directories must NOT be added in a single add/addModify call (via file list). Also, it is important that the second directory is added AFTER the first directory. So, to reproduce the error, create a (new) directory, copy the attached file into it, and create/copy another file (I created a file named a.txt, containing 'abc' - note that the second file must not be empty, as it is not added otherwise) in/to it. Adapt the test script to add this directory first, and then an arbitrary other directory (you may create an empty directory to keep things simple). Then run the script and try to open the resulting tar.gz file - it should be broken. The problem did only occur when using gzip (or bzip2). Creating a plain tar file and using gzencode or gzopen/gzputs separately on it does work correctly. Test script: --------------- <?php $compressor = new Archive_Tar('/tmp/debug.tar.gz', 'gz'); $compressor->add('testdebug'); $compressor->add('testdebug2'); ?> Expected result: ---------------- A valid .tar.gz file. Actual result: -------------- An invalid tar.gz file.

Comments

 [2012-03-12 11:38 UTC] schmale (Alexander Schmale)
I'm unable to attach the problematic file. The file is a png image of about 17K size. Please tell me where to mail (or send) the file.
 [2012-03-31 17:17 UTC] doconnor (Daniel O'Connor)
Perhaps post as a gist?
 [2012-04-02 11:03 UTC] schmale (Alexander Schmale)
Hi there, I could send you a download link, if you're the one responsible for fixing this. I'm wondering because you're not listed as package maintainer. It's not that this file is supersecret or what, just don't want to bother the wrong people.
 [2012-04-02 12:31 UTC] mrook (Michiel Rook)
I'll be the one fixing it; you can send it to mrook AT php DOT net. Thanks!
 [2012-04-05 09:20 UTC] mrook (Michiel Rook)
I can reproduce it now, thanks for the attachment. This one seems related to #13361.
 [2012-04-05 09:20 UTC] mrook (Michiel Rook)
-Roadmap Versions: +Roadmap Versions: 1.3.10
 [2012-04-05 09:48 UTC] mrook (Michiel Rook)
-Status: Open +Status: Closed -Assigned To: +Assigned To: mrook
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.