FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19330&edit=1

ID: 19330
Updated by: schmale@froglogic.com
Reported By: schmale at froglogic dot com
Summary: Class creates incorrect (non-readable) tar.gz file
Status: Open
Type: Bug
Package: Archive_Tar
Operating System: Ubuntu
Package Version: 1.3.9
PHP Version: 5.3.6
Roadmap Versions:
New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2012-03-12 11:31:00] 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.

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Mar 31, 2012 at 4:14 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19330&edit=1

    ID: 19330
    Updated by: daniel.oconnor@gmail.com
    Reported By: schmale at froglogic dot com
    Summary: Class creates incorrect (non-readable) tar.gz file
    Status: Open
    Type: Bug
    Package: Archive_Tar
    Operating System: Ubuntu
    Package Version: 1.3.9
    PHP Version: 5.3.6
    Roadmap Versions:
    New Comment:

    Perhaps post as a gist?


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-03-12 11:38:13] 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-12 11:31:00] 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.

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 12, '12 at 10:35a
activeMar 31, '12 at 4:14p
posts2
users2
websitepear.php.net

2 users in discussion

Schmale: 1 post Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase