diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
| commit | 8f1428d29ef91d74b4d272af171675f2971eb15b (patch) | |
| tree | a1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /tests/security | |
| parent | c6e4182351e0173fe58de141e143aac2eacf5efe (diff) | |
| download | php-8f1428d29ef91d74b4d272af171675f2971eb15b.tar.gz | |
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'tests/security')
| -rw-r--r-- | tests/security/open_basedir_001.phpt | 22 | ||||
| -rw-r--r-- | tests/security/open_basedir_glob-win32.phpt | 59 | ||||
| -rw-r--r-- | tests/security/open_basedir_glob.phpt | 6 | ||||
| -rw-r--r-- | tests/security/open_basedir_parse_ini_file.phpt | 49 |
4 files changed, 43 insertions, 93 deletions
diff --git a/tests/security/open_basedir_001.phpt b/tests/security/open_basedir_001.phpt new file mode 100644 index 000000000..e05861a81 --- /dev/null +++ b/tests/security/open_basedir_001.phpt @@ -0,0 +1,22 @@ +--TEST-- +openbase_dir runtime tightning +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip.. only for unix'); +} +--INI-- +open_basedir=/usr/local +--FILE-- +<?php +var_dump(ini_set("open_basedir", "/usr/local/bin")); +var_dump(ini_get("open_basedir")); +var_dump(ini_set("open_basedir", "/usr")); +var_dump(ini_get("open_basedir")); +?> +--EXPECT-- +string(10) "/usr/local" +string(14) "/usr/local/bin" +bool(false) +string(14) "/usr/local/bin" + diff --git a/tests/security/open_basedir_glob-win32.phpt b/tests/security/open_basedir_glob-win32.phpt deleted file mode 100644 index 3fa19afa3..000000000 --- a/tests/security/open_basedir_glob-win32.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip Windows only variation'); -} -?> ---INI-- -open_basedir=. ---FILE-- -<?php -require_once "open_basedir.inc"; -test_open_basedir("glob"); -?> ---CLEAN-- -<?php -require_once "open_basedir.inc"; -delete_directories(); -?> ---EXPECTF-- -*** Testing open_basedir configuration [glob] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -array(0) { -} -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - string(5) "../ok" -} -array(1) { - [0]=> - string(6) "ok.txt" -} -array(1) { - [0]=> - string(12) "../ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/../ok/ok.txt" -} -*** Finished testing open_basedir configuration [glob] *** - diff --git a/tests/security/open_basedir_glob.phpt b/tests/security/open_basedir_glob.phpt index 591cd8f4f..602e48dfc 100644 --- a/tests/security/open_basedir_glob.phpt +++ b/tests/security/open_basedir_glob.phpt @@ -1,11 +1,5 @@ --TEST-- Test open_basedir configuration ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip Not for Windows variation'); -} -?> --INI-- open_basedir=. --FILE-- diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt index 926c07771..d69adeb5e 100644 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -37,46 +37,39 @@ bool(true) bool(true) bool(true) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test\bad): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test\bad\bad.txt): failed to open stream: %s in %s on line %d -array(0) { -} +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 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test\bad): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test\bad\bad.txt): failed to open stream: %s in %s on line %d -array(0) { -} +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 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +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 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 +bool(false) *** Finished testing open_basedir configuration [parse_ini_file] *** |
