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

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