PATH:
opt
/
alt
/
tests
/
alt-php82-pecl-rar_4.2.0-3.el8
/
tests
--TEST-- RarEntry::extract() process extended (Windows) --SKIPIF-- <?php if(!extension_loaded("rar")) die("skip"); die("skip test is not working under run-tests"); if (PHP_OS != 'WINNT') die("skip test for Windows NT"); exec('cacls ' . escapeshellarg(dirname(__FILE__)), $perms); function concat($a,$b) { return $a.$b; } $perms = array_reduce($perms, 'concat'); if (preg_match('/.* Everyone:\\(OI\\)\\(CI\\)F/i', $perms)) die("skip directory has permissions that conflict with this test"); ?> --CLEAN-- @rmdir(dirname(__FILE__).'/temp_directory'); --FILE-- <?php $fn1 = dirname(__FILE__) . '/dirs_and_extra_headers.rar'; $dest = dirname(__FILE__).'/temp_directory'; function concat($a,$b) { return $a.$b; } @rmdir($dest); echo "--> should have default permissions:\n"; $rarF = RarArchive::open($fn1); $t = $rarF->getEntry('allow_everyone_ni'); $t->extract(false, $dest, NULL); exec('cacls ' . escapeshellarg($dest), $perms); $perms = array_reduce($perms, 'concat'); var_dump(preg_match('/.* Everyone:\\(OI\\)\\(CI\\)F/i', $perms)); @rmdir($dest); echo "\n"; echo "--> should have permissions for everyone:\n"; $rarF = RarArchive::open($fn1); $t = $rarF->getEntry('allow_everyone_ni'); $t->extract(false, $dest, NULL, true); exec('cacls ' . escapeshellarg($dest), $perms); $perms = array_reduce($perms, 'concat'); var_dump(preg_match('/.* Everyone:\\(OI\\)\\(CI\\)F/i', $perms)); echo "\n"; @rmdir($dest); echo "Done\n"; --EXPECTF-- --> should have default permissions: int(0) --> should have permissions for everyone: int(1) Done
[+]
..
[-] multi.part3.rar
[edit]
[-] 080.phpt
[edit]
[-] 003.phpt
[edit]
[-] 079.phpt
[edit]
[-] 032.phpt
[edit]
[-] 108.phpt
[edit]
[-] 110.phpt
[edit]
[-] secret-crypted-none.rar
[edit]
[-] 042.phpt
[edit]
[-] store_method.rar
[edit]
[-] 001.phpt
[edit]
[-] 071.phpt
[edit]
[-] 059.phpt
[edit]
[-] 087.phpt
[edit]
[-] 006.phpt
[edit]
[-] 017.phpt
[edit]
[-] 105.phpt
[edit]
[-] 073.phpt
[edit]
[-] 099.phpt
[edit]
[-] 050.phpt
[edit]
[-] rar_unicode.rar
[edit]
[-] 109.phpt
[edit]
[-] 054.phpt
[edit]
[-] 103.phpt
[edit]
[-] 069.phpt
[edit]
[-] 096.phpt
[edit]
[-] garbage.part03.rar
[edit]
[-] rar_notrar.rar
[edit]
[-] 049.phpt
[edit]
[-] corrupted.rar
[edit]
[-] 038.phpt
[edit]
[-] 098.phpt
[edit]
[-] 112.phpt
[edit]
[-] 113.phpt
[edit]
[-] 107.phpt
[edit]
[-] 029.phpt
[edit]
[-] 075.phpt
[edit]
[-] 062.phpt
[edit]
[-] 007.phpt
[edit]
[-] 077.phpt
[edit]
[-] 106.phpt
[edit]
[-] multi.part1.rar
[edit]
[-] solid.rar
[edit]
[-] 089.phpt
[edit]
[-] 014.phpt
[edit]
[-] 068.phpt
[edit]
[-] 012.phpt
[edit]
[-] repeated_name.rar
[edit]
[-] 041.phpt
[edit]
[-] 010.phpt
[edit]
[-] 013.phpt
[edit]
[-] 030.phpt
[edit]
[-] 025.phpt
[edit]
[-] 088.phpt
[edit]
[-] 091.phpt
[edit]
[-] 035.phpt
[edit]
[-] linux_rar.rar
[edit]
[-] 086.phpt
[edit]
[-] 053.phpt
[edit]
[-] 004.phpt
[edit]
[-] 047.phpt
[edit]
[-] 018.phpt
[edit]
[-] php8compat.php.inc
[edit]
[-] empty_file.rar
[edit]
[-] encrypted_only_files.rar
[edit]
[-] 026.phpt
[edit]
[-] 4mb.rar
[edit]
[-] 097.phpt
[edit]
[-] 065.phpt
[edit]
[-] 027.phpt
[edit]
[-] 115.phpt
[edit]
[-] 019.phpt
[edit]
[-] 020.phpt
[edit]
[-] 078.phpt
[edit]
[-] rar5_multi.part1.rar
[edit]
[-] 074.phpt
[edit]
[-] commented.rar
[edit]
[-] 111.phpt
[edit]
[-] multi_broken.part1.rar
[edit]
[-] 036.phpt
[edit]
[-] 055.phpt
[edit]
[-] 002.phpt
[edit]
[-] dirlink_unix.rar
[edit]
[-] encrypted_headers.rar
[edit]
[-] 040.phpt
[edit]
[-] 081.phpt
[edit]
[-] 085.phpt
[edit]
[-] 009.phpt
[edit]
[-] 104.phpt
[edit]
[-] 114.phpt
[edit]
[-] sparsefiles_rar.rar
[edit]
[-] 094.phpt
[edit]
[-] 051.phpt
[edit]
[-] 037.phpt
[edit]
[-] 043.phpt
[edit]
[-] 031.phpt
[edit]
[-] 101.phpt
[edit]
[-] 005.phpt
[edit]
[-] 058.phpt
[edit]
[-] 066.phpt
[edit]
[-] 008.phpt
[edit]
[-] rar5_multi.part2.rar
[edit]
[-] 102.phpt
[edit]
[-] multi.part2.rar
[edit]
[-] 028.phpt
[edit]
[-] 011.phpt
[edit]
[-] 052.phpt
[edit]
[-] 039.phpt
[edit]
[-] 044.phpt
[edit]
[-] latest_winrar.rar
[edit]
[-] 092.phpt
[edit]
[-] 057.phpt
[edit]
[-] 064.phpt
[edit]
[-] 070.phpt
[edit]
[-] 061.phpt
[edit]
[-] 056.phpt
[edit]
[-] 090.phpt
[edit]
[-] 015.phpt
[edit]
[-] 046.phpt
[edit]
[-] 072.phpt
[edit]
[-] 063.phpt
[edit]
[-] rar5-links.rar
[edit]
[-] 082.phpt
[edit]
[-] 022.phpt
[edit]
[-] 016.phpt
[edit]
[-] 033.phpt
[edit]
[-] 093.phpt
[edit]
[-] directories.rar
[edit]
[-] 060.phpt
[edit]
[-] 021.phpt
[edit]
[-] 076.phpt
[edit]
[-] secret-none.rar
[edit]
[-] 023.phpt
[edit]
[-] 095.phpt
[edit]
[-] 100.phpt
[edit]
[-] dirs_and_extra_headers.rar
[edit]
[-] 048.phpt
[edit]
[-] 067.phpt
[edit]
[-] 024.phpt
[edit]
[-] 034.phpt
[edit]