Annotation of embedaddon/php/tests/security/open_basedir_error_log_variation.phpt, revision 1.1.1.1

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("error_log");
                     10: 
                     11: define("DESTINATION_IS_FILE", 3);
                     12: 
                     13: var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad/bad.txt"));
                     14: var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad.txt"));
                     15: var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/bad.txt"));
                     16: var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/ok/ok.txt"));
                     17: 
                     18: test_open_basedir_after("error_log");
                     19: ?>
                     20: --CLEAN--
                     21: <?php
                     22: require_once "open_basedir.inc";
                     23: delete_directories();
                     24: ?>
                     25: --EXPECTF--
                     26: *** Testing open_basedir configuration [error_log] ***
                     27: bool(true)
                     28: bool(true)
                     29: bool(true)
                     30: bool(true)
                     31: bool(true)
                     32: 
                     33: Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
                     34: 
                     35: Warning: error_log(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
                     36: bool(false)
                     37: 
                     38: Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d
                     39: 
                     40: Warning: error_log(%s/test/bad.txt): failed to open stream: %s in %s on line %d
                     41: bool(false)
                     42: 
                     43: Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d
                     44: 
                     45: Warning: error_log(%s/bad.txt): failed to open stream: %s in %s on line %d
                     46: bool(false)
                     47: bool(true)
                     48: *** Finished testing open_basedir configuration [error_log] ***
                     49: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>