Return to open_basedir_unlink.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / security |
1.1 ! misho 1: --TEST-- ! 2: Test open_basedir configuration ! 3: --INI-- ! 4: open_basedir=. ! 5: --FILE-- ! 6: <?php ! 7: require_once "open_basedir.inc"; ! 8: $initdir = getcwd(); ! 9: test_open_basedir_before("unlink"); ! 10: ! 11: var_dump(unlink("../bad/bad.txt")); ! 12: var_dump(unlink(".././bad/bad.txt")); ! 13: var_dump(unlink("../bad/../bad/bad.txt")); ! 14: var_dump(unlink("./.././bad/bad.txt")); ! 15: var_dump(unlink($initdir."/test/bad/bad.txt")); ! 16: ! 17: test_open_basedir_after("unlink"); ! 18: ?> ! 19: --CLEAN-- ! 20: <?php ! 21: require_once "open_basedir.inc"; ! 22: delete_directories(); ! 23: ?> ! 24: --EXPECTF-- ! 25: *** Testing open_basedir configuration [unlink] *** ! 26: bool(true) ! 27: bool(true) ! 28: bool(true) ! 29: bool(true) ! 30: bool(true) ! 31: ! 32: Warning: unlink(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d ! 33: bool(false) ! 34: ! 35: Warning: unlink(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d ! 36: bool(false) ! 37: ! 38: Warning: unlink(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d ! 39: bool(false) ! 40: ! 41: Warning: unlink(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d ! 42: bool(false) ! 43: ! 44: Warning: unlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d ! 45: bool(false) ! 46: *** Finished testing open_basedir configuration [unlink] *** ! 47: