File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / security / open_basedir_parse_ini_file.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Test open_basedir configuration
    3: --INI--
    4: open_basedir=.
    5: --SKIPIF--
    6: <?php
    7: if (substr(PHP_OS, 0, 3) != 'WIN') {
    8:     die('skip Windows only variation');
    9: }
   10: ?>
   11: --FILE--
   12: <?php
   13: require_once "open_basedir.inc";
   14: test_open_basedir_before("parse_ini_file");
   15: $directory = dirname(__FILE__);
   16: 
   17: var_dump(parse_ini_file("../bad"));
   18: var_dump(parse_ini_file("../bad/bad.txt"));
   19: var_dump(parse_ini_file(".."));
   20: var_dump(parse_ini_file("../"));
   21: var_dump(parse_ini_file("../bad/."));
   22: var_dump(parse_ini_file("../bad/./bad.txt"));
   23: var_dump(parse_ini_file("./../."));
   24: 
   25: test_open_basedir_after("parse_ini_file");
   26: ?>
   27: --CLEAN--
   28: <?php
   29: require_once "open_basedir.inc";
   30: delete_directories();
   31: ?>
   32: --EXPECTF--
   33: *** Testing open_basedir configuration [parse_ini_file] ***
   34: bool(true)
   35: bool(true)
   36: bool(true)
   37: bool(true)
   38: bool(true)
   39: 
   40: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 6
   41: 
   42: Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6
   43: bool(false)
   44: 
   45: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 7
   46: 
   47: Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7
   48: bool(false)
   49: 
   50: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 8
   51: 
   52: Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8
   53: bool(false)
   54: 
   55: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 9
   56: 
   57: Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9
   58: bool(false)
   59: 
   60: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 10
   61: 
   62: Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10
   63: bool(false)
   64: 
   65: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 11
   66: 
   67: Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11
   68: bool(false)
   69: 
   70: Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 12
   71: 
   72: Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12
   73: bool(false)
   74: *** Finished testing open_basedir configuration [parse_ini_file] ***
   75: 

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