diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-11-04 10:36:58 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-11-04 10:36:58 +0100 |
commit | 421a2704022cbc8fa07ab673c2d503199f460b8e (patch) | |
tree | 8e4b9a5050b7d1b94aa24a0c969c72cd4cee8e74 /_test | |
parent | fba11f64c26a8dde5f64c57233b0da84fae35959 (diff) | |
download | rpg-421a2704022cbc8fa07ab673c2d503199f460b8e.tar.gz rpg-421a2704022cbc8fa07ab673c2d503199f460b8e.tar.bz2 |
Tar: Added extraction support for long file names
Supports POSIX ustar prefixes and GNU longlink entries
Diffstat (limited to '_test')
-rw-r--r-- | _test/tests/inc/tar.test.php | 17 | ||||
-rw-r--r-- | _test/tests/inc/tar/longpath-gnu.tgz | bin | 0 -> 413 bytes | |||
-rw-r--r-- | _test/tests/inc/tar/longpath-ustar.tgz | bin | 0 -> 311 bytes |
3 files changed, 16 insertions, 1 deletions
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php index 4de9e668d..9abd27612 100644 --- a/_test/tests/inc/tar.test.php +++ b/_test/tests/inc/tar.test.php @@ -218,7 +218,6 @@ class Tar_TestCase extends DokuWikiTest { } } - /** * Check the extension to compression guesser */ @@ -234,4 +233,20 @@ class Tar_TestCase extends DokuWikiTest { $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.BZ2')); $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.bz2')); } + + public function test_longpathextract(){ + $dir = dirname(__FILE__).'/tar'; + $out = sys_get_temp_dir().'/dwtartest'.md5(time()); + + foreach(array('ustar','gnu') as $format){ + $tar = new Tar(); + $tar->open("$dir/longpath-$format.tgz"); + $tar->extract($out); + + $this->assertFileExists($out.'/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/test.txt'); + + TestUtils::rdelete($out); + } + } + }
\ No newline at end of file diff --git a/_test/tests/inc/tar/longpath-gnu.tgz b/_test/tests/inc/tar/longpath-gnu.tgz Binary files differnew file mode 100644 index 000000000..6c937c8fe --- /dev/null +++ b/_test/tests/inc/tar/longpath-gnu.tgz diff --git a/_test/tests/inc/tar/longpath-ustar.tgz b/_test/tests/inc/tar/longpath-ustar.tgz Binary files differnew file mode 100644 index 000000000..59efbff66 --- /dev/null +++ b/_test/tests/inc/tar/longpath-ustar.tgz |