From 863d9751969891158b33476fb63e7f860dda87e1 Mon Sep 17 00:00:00 2001 From: Ant Phillips Date: Fri, 9 May 2008 08:39:44 +0000 Subject: Collect all the open_basedir security tests into one place --- tests/security/open_basedir.inc | 133 +++++++++++++++++++++ tests/security/open_basedir_chdir.phpt | 51 ++++++++ tests/security/open_basedir_chmod.phpt | 71 +++++++++++ tests/security/open_basedir_copy.phpt | 79 ++++++++++++ tests/security/open_basedir_copy_variation1.phpt | 35 ++++++ tests/security/open_basedir_dir.phpt | 88 ++++++++++++++ tests/security/open_basedir_disk_free_space.phpt | 52 ++++++++ tests/security/open_basedir_error_log.phpt | 43 +++++++ .../security/open_basedir_error_log_variation.phpt | 48 ++++++++ tests/security/open_basedir_file.phpt | 88 ++++++++++++++ tests/security/open_basedir_file_exists.phpt | 55 +++++++++ tests/security/open_basedir_file_get_contents.phpt | 75 ++++++++++++ tests/security/open_basedir_file_put_contents.phpt | 57 +++++++++ tests/security/open_basedir_fileatime.phpt | 55 +++++++++ tests/security/open_basedir_filectime.phpt | 55 +++++++++ tests/security/open_basedir_filegroup.phpt | 55 +++++++++ tests/security/open_basedir_fileinode.phpt | 55 +++++++++ tests/security/open_basedir_filemtime.phpt | 55 +++++++++ tests/security/open_basedir_fileowner.phpt | 55 +++++++++ tests/security/open_basedir_fileperms.phpt | 55 +++++++++ tests/security/open_basedir_filesize.phpt | 55 +++++++++ tests/security/open_basedir_filetype.phpt | 55 +++++++++ tests/security/open_basedir_fopen.phpt | 86 +++++++++++++ tests/security/open_basedir_glob-win32.phpt | 59 +++++++++ tests/security/open_basedir_glob.phpt | 58 +++++++++ tests/security/open_basedir_is_dir.phpt | 55 +++++++++ tests/security/open_basedir_is_executable.phpt | 59 +++++++++ tests/security/open_basedir_is_file.phpt | 55 +++++++++ tests/security/open_basedir_is_link.phpt | 55 +++++++++ tests/security/open_basedir_is_readable.phpt | 55 +++++++++ tests/security/open_basedir_is_writable.phpt | 55 +++++++++ tests/security/open_basedir_link.phpt | 78 ++++++++++++ tests/security/open_basedir_linkinfo.phpt | 64 ++++++++++ tests/security/open_basedir_lstat.phpt | 55 +++++++++ tests/security/open_basedir_mkdir.phpt | 52 ++++++++ tests/security/open_basedir_opendir.phpt | 73 +++++++++++ tests/security/open_basedir_parse_ini_file.phpt | 82 +++++++++++++ tests/security/open_basedir_readlink.phpt | 76 ++++++++++++ tests/security/open_basedir_realpath.phpt | 61 ++++++++++ tests/security/open_basedir_rename.phpt | 47 ++++++++ tests/security/open_basedir_rmdir.phpt | 47 ++++++++ tests/security/open_basedir_scandir.phpt | 110 +++++++++++++++++ tests/security/open_basedir_stat.phpt | 55 +++++++++ tests/security/open_basedir_symlink.phpt | 78 ++++++++++++ tests/security/open_basedir_tempnam.phpt | 57 +++++++++ tests/security/open_basedir_touch.phpt | 70 +++++++++++ tests/security/open_basedir_unlink.phpt | 47 ++++++++ 47 files changed, 2959 insertions(+) create mode 100644 tests/security/open_basedir.inc create mode 100644 tests/security/open_basedir_chdir.phpt create mode 100644 tests/security/open_basedir_chmod.phpt create mode 100644 tests/security/open_basedir_copy.phpt create mode 100644 tests/security/open_basedir_copy_variation1.phpt create mode 100644 tests/security/open_basedir_dir.phpt create mode 100644 tests/security/open_basedir_disk_free_space.phpt create mode 100644 tests/security/open_basedir_error_log.phpt create mode 100644 tests/security/open_basedir_error_log_variation.phpt create mode 100644 tests/security/open_basedir_file.phpt create mode 100644 tests/security/open_basedir_file_exists.phpt create mode 100644 tests/security/open_basedir_file_get_contents.phpt create mode 100644 tests/security/open_basedir_file_put_contents.phpt create mode 100644 tests/security/open_basedir_fileatime.phpt create mode 100644 tests/security/open_basedir_filectime.phpt create mode 100644 tests/security/open_basedir_filegroup.phpt create mode 100644 tests/security/open_basedir_fileinode.phpt create mode 100644 tests/security/open_basedir_filemtime.phpt create mode 100644 tests/security/open_basedir_fileowner.phpt create mode 100644 tests/security/open_basedir_fileperms.phpt create mode 100644 tests/security/open_basedir_filesize.phpt create mode 100644 tests/security/open_basedir_filetype.phpt create mode 100644 tests/security/open_basedir_fopen.phpt create mode 100644 tests/security/open_basedir_glob-win32.phpt create mode 100644 tests/security/open_basedir_glob.phpt create mode 100644 tests/security/open_basedir_is_dir.phpt create mode 100644 tests/security/open_basedir_is_executable.phpt create mode 100644 tests/security/open_basedir_is_file.phpt create mode 100644 tests/security/open_basedir_is_link.phpt create mode 100644 tests/security/open_basedir_is_readable.phpt create mode 100644 tests/security/open_basedir_is_writable.phpt create mode 100644 tests/security/open_basedir_link.phpt create mode 100644 tests/security/open_basedir_linkinfo.phpt create mode 100644 tests/security/open_basedir_lstat.phpt create mode 100644 tests/security/open_basedir_mkdir.phpt create mode 100644 tests/security/open_basedir_opendir.phpt create mode 100644 tests/security/open_basedir_parse_ini_file.phpt create mode 100644 tests/security/open_basedir_readlink.phpt create mode 100644 tests/security/open_basedir_realpath.phpt create mode 100644 tests/security/open_basedir_rename.phpt create mode 100644 tests/security/open_basedir_rmdir.phpt create mode 100644 tests/security/open_basedir_scandir.phpt create mode 100644 tests/security/open_basedir_stat.phpt create mode 100644 tests/security/open_basedir_symlink.phpt create mode 100644 tests/security/open_basedir_tempnam.phpt create mode 100644 tests/security/open_basedir_touch.phpt create mode 100644 tests/security/open_basedir_unlink.phpt (limited to 'tests/security') diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc new file mode 100644 index 0000000000..7fd0afc8bb --- /dev/null +++ b/tests/security/open_basedir.inc @@ -0,0 +1,133 @@ + + diff --git a/tests/security/open_basedir_chdir.phpt b/tests/security/open_basedir_chdir.phpt new file mode 100644 index 0000000000..32ed4eb1ec --- /dev/null +++ b/tests/security/open_basedir_chdir.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [chdir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: chdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chdir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chdir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chdir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [chdir] *** + diff --git a/tests/security/open_basedir_chmod.phpt b/tests/security/open_basedir_chmod.phpt new file mode 100644 index 0000000000..02fdce5a1b --- /dev/null +++ b/tests/security/open_basedir_chmod.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [chmod] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: chmod(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: chmod(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [chmod] *** + diff --git a/tests/security/open_basedir_copy.phpt b/tests/security/open_basedir_copy.phpt new file mode 100644 index 0000000000..8f0f7a91fd --- /dev/null +++ b/tests/security/open_basedir_copy.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [copy] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: copy(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(../bad): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(..): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(../): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(/): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(../bad/.): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(../bad/./bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: copy(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d + +Warning: copy(./../.): failed to open stream: Operation not permitted in %s on line %d +bool(false) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [copy] *** + diff --git a/tests/security/open_basedir_copy_variation1.phpt b/tests/security/open_basedir_copy_variation1.phpt new file mode 100644 index 0000000000..de532e12cb --- /dev/null +++ b/tests/security/open_basedir_copy_variation1.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [copy] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: unlink(copy.txt): No such file or directory in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [copy] *** + diff --git a/tests/security/open_basedir_dir.phpt b/tests/security/open_basedir_dir.phpt new file mode 100644 index 0000000000..33fb6ac9be --- /dev/null +++ b/tests/security/open_basedir_dir.phpt @@ -0,0 +1,88 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [dir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(../bad): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(..): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(../): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(/): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(../bad/.): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(%s/test/bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: dir(%s/test/bad/../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) +object(Directory)#%d (2) { + ["path"]=> + string(%d) "%s/test/ok/" + ["handle"]=> + resource(%d) of type (stream) +} +object(Directory)#%d (2) { + ["path"]=> + string(%d) "%s/test/ok" + ["handle"]=> + resource(%d) of type (stream) +} +object(Directory)#%d (2) { + ["path"]=> + string(%d) "%s/test/ok/../ok" + ["handle"]=> + resource(%d) of type (stream) +} +*** Finished testing open_basedir configuration [dir] *** + diff --git a/tests/security/open_basedir_disk_free_space.phpt b/tests/security/open_basedir_disk_free_space.phpt new file mode 100644 index 0000000000..e3e36e670a --- /dev/null +++ b/tests/security/open_basedir_disk_free_space.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [disk_free_space] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: disk_free_space(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +float(%s) +*** Finished testing open_basedir configuration [disk_free_space] *** diff --git a/tests/security/open_basedir_error_log.phpt b/tests/security/open_basedir_error_log.phpt new file mode 100644 index 0000000000..62bb5cada0 --- /dev/null +++ b/tests/security/open_basedir_error_log.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [error_log] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: ini_set(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +string(0) "" +string(%d) "%s/test/ok/ok.txt" +*** Finished testing open_basedir configuration [error_log] *** + diff --git a/tests/security/open_basedir_error_log_variation.phpt b/tests/security/open_basedir_error_log_variation.phpt new file mode 100644 index 0000000000..c0295f6506 --- /dev/null +++ b/tests/security/open_basedir_error_log_variation.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [error_log] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +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 + +Warning: error_log(%s/test/bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +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 + +Warning: error_log(%s/test/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: error_log(%s/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) +bool(true) +*** Finished testing open_basedir configuration [error_log] *** + diff --git a/tests/security/open_basedir_file.phpt b/tests/security/open_basedir_file.phpt new file mode 100644 index 0000000000..fbc841e3fe --- /dev/null +++ b/tests/security/open_basedir_file.phpt @@ -0,0 +1,88 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [file] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(../bad): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(..): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(../): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(/): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(../bad/.): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: 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: file(%s/test/bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: file(%s/test/bad/../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) +array(1) { + [0]=> + string(12) "Hello World!" +} +array(1) { + [0]=> + string(12) "Hello World!" +} +array(1) { + [0]=> + string(12) "Hello World!" +} +array(1) { + [0]=> + string(12) "Hello World!" +} +*** Finished testing open_basedir configuration [file] *** + diff --git a/tests/security/open_basedir_file_exists.phpt b/tests/security/open_basedir_file_exists.phpt new file mode 100644 index 0000000000..c249fc1165 --- /dev/null +++ b/tests/security/open_basedir_file_exists.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [file_exists] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: file_exists(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: file_exists(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [file_exists] *** + diff --git a/tests/security/open_basedir_file_get_contents.phpt b/tests/security/open_basedir_file_get_contents.phpt new file mode 100644 index 0000000000..637c499eae --- /dev/null +++ b/tests/security/open_basedir_file_get_contents.phpt @@ -0,0 +1,75 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [file_get_contents] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: file_get_contents(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(../bad): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(..): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(../): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(/): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(../bad/.): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(%s/test/bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: file_get_contents(%s/test/bad/../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) +string(12) "Hello World!" +string(12) "Hello World!" +string(12) "Hello World!" +string(12) "Hello World!" +*** Finished testing open_basedir configuration [file_get_contents] *** diff --git a/tests/security/open_basedir_file_put_contents.phpt b/tests/security/open_basedir_file_put_contents.phpt new file mode 100644 index 0000000000..d4bd417b59 --- /dev/null +++ b/tests/security/open_basedir_file_put_contents.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [file_put_contents] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +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 + +Warning: file_put_contents(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +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 + +Warning: file_put_contents(.././bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +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 + +Warning: file_put_contents(../bad/../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +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 + +Warning: file_put_contents(./.././bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +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 + +Warning: file_put_contents%s/test/bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [file_put_contents] *** + diff --git a/tests/security/open_basedir_fileatime.phpt b/tests/security/open_basedir_fileatime.phpt new file mode 100644 index 0000000000..02cc94f83f --- /dev/null +++ b/tests/security/open_basedir_fileatime.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [fileatime] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: fileatime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileatime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [fileatime] *** + diff --git a/tests/security/open_basedir_filectime.phpt b/tests/security/open_basedir_filectime.phpt new file mode 100644 index 0000000000..542c8423ed --- /dev/null +++ b/tests/security/open_basedir_filectime.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [filectime] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: filectime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filectime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [filectime] *** + diff --git a/tests/security/open_basedir_filegroup.phpt b/tests/security/open_basedir_filegroup.phpt new file mode 100644 index 0000000000..5f6279aa8f --- /dev/null +++ b/tests/security/open_basedir_filegroup.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [filegroup] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: filegroup(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filegroup(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [filegroup] *** + diff --git a/tests/security/open_basedir_fileinode.phpt b/tests/security/open_basedir_fileinode.phpt new file mode 100644 index 0000000000..070c2c806c --- /dev/null +++ b/tests/security/open_basedir_fileinode.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [fileinode] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: fileinode(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileinode(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [fileinode] *** + diff --git a/tests/security/open_basedir_filemtime.phpt b/tests/security/open_basedir_filemtime.phpt new file mode 100644 index 0000000000..7213ddb5b9 --- /dev/null +++ b/tests/security/open_basedir_filemtime.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [filemtime] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: filemtime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filemtime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [filemtime] *** + diff --git a/tests/security/open_basedir_fileowner.phpt b/tests/security/open_basedir_fileowner.phpt new file mode 100644 index 0000000000..b363b7e0e8 --- /dev/null +++ b/tests/security/open_basedir_fileowner.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [fileowner] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: fileowner(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileowner(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [fileowner] *** + diff --git a/tests/security/open_basedir_fileperms.phpt b/tests/security/open_basedir_fileperms.phpt new file mode 100644 index 0000000000..a1e6511b08 --- /dev/null +++ b/tests/security/open_basedir_fileperms.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [fileperms] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: fileperms(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: fileperms(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [fileperms] *** + diff --git a/tests/security/open_basedir_filesize.phpt b/tests/security/open_basedir_filesize.phpt new file mode 100644 index 0000000000..a335dfd17c --- /dev/null +++ b/tests/security/open_basedir_filesize.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [filesize] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: filesize(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filesize(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +*** Finished testing open_basedir configuration [filesize] *** + diff --git a/tests/security/open_basedir_filetype.phpt b/tests/security/open_basedir_filetype.phpt new file mode 100644 index 0000000000..5091db56f9 --- /dev/null +++ b/tests/security/open_basedir_filetype.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [filetype] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: filetype(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: filetype(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +string(3) "dir" +string(4) "file" +string(4) "file" +string(4) "file" +string(4) "file" +*** Finished testing open_basedir configuration [filetype] *** + diff --git a/tests/security/open_basedir_fopen.phpt b/tests/security/open_basedir_fopen.phpt new file mode 100644 index 0000000000..c6c9a253f2 --- /dev/null +++ b/tests/security/open_basedir_fopen.phpt @@ -0,0 +1,86 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [fopen] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: fopen(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(../bad): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(..): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(../): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(/): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(../bad/.): failed to open stream: Operation not permitted in %s on line %d +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(../bad/./bad.txt): failed to open stream: Operation not permitted in %s on line 12 +bool(false) + +Warning: fopen(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d + +Warning: fopen(./../.): failed to open stream: Operation not permitted in %s on line %d +bool(false) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +*** Finished testing open_basedir configuration [fopen] *** + diff --git a/tests/security/open_basedir_glob-win32.phpt b/tests/security/open_basedir_glob-win32.phpt new file mode 100644 index 0000000000..3fa19afa36 --- /dev/null +++ b/tests/security/open_basedir_glob-win32.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--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 new file mode 100644 index 0000000000..591cd8f4f7 --- /dev/null +++ b/tests/security/open_basedir_glob.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [glob] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +bool(false) +bool(false) +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_is_dir.phpt b/tests/security/open_basedir_is_dir.phpt new file mode 100644 index 0000000000..e4ad620d74 --- /dev/null +++ b/tests/security/open_basedir_is_dir.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_dir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_dir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(false) +bool(false) +bool(false) +bool(false) +*** Finished testing open_basedir configuration [is_dir] *** + diff --git a/tests/security/open_basedir_is_executable.phpt b/tests/security/open_basedir_is_executable.phpt new file mode 100644 index 0000000000..1bab860557 --- /dev/null +++ b/tests/security/open_basedir_is_executable.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_executable] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_executable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +*** Finished testing open_basedir configuration [is_executable] *** diff --git a/tests/security/open_basedir_is_file.phpt b/tests/security/open_basedir_is_file.phpt new file mode 100644 index 0000000000..51ef0a2d1f --- /dev/null +++ b/tests/security/open_basedir_is_file.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_file] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_file(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [is_file] *** + diff --git a/tests/security/open_basedir_is_link.phpt b/tests/security/open_basedir_is_link.phpt new file mode 100644 index 0000000000..5d12148d85 --- /dev/null +++ b/tests/security/open_basedir_is_link.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_link] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_link(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_link(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +*** Finished testing open_basedir configuration [is_link] *** + diff --git a/tests/security/open_basedir_is_readable.phpt b/tests/security/open_basedir_is_readable.phpt new file mode 100644 index 0000000000..951a19ac76 --- /dev/null +++ b/tests/security/open_basedir_is_readable.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_readable] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_readable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_readable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [is_readable] *** + diff --git a/tests/security/open_basedir_is_writable.phpt b/tests/security/open_basedir_is_writable.phpt new file mode 100644 index 0000000000..25ce1c63a4 --- /dev/null +++ b/tests/security/open_basedir_is_writable.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [is_writable] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: is_writable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: is_writable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [is_writable] *** + diff --git a/tests/security/open_basedir_link.phpt b/tests/security/open_basedir_link.phpt new file mode 100644 index 0000000000..a54c22f4b6 --- /dev/null +++ b/tests/security/open_basedir_link.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [link] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [link] *** + diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt new file mode 100644 index 0000000000..ab12a5149d --- /dev/null +++ b/tests/security/open_basedir_linkinfo.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [linkinfo] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +int(%d) + +Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [linkinfo] *** + diff --git a/tests/security/open_basedir_lstat.phpt b/tests/security/open_basedir_lstat.phpt new file mode 100644 index 0000000000..35e5a22019 --- /dev/null +++ b/tests/security/open_basedir_lstat.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [lstat] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: lstat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: lstat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [lstat] *** + diff --git a/tests/security/open_basedir_mkdir.phpt b/tests/security/open_basedir_mkdir.phpt new file mode 100644 index 0000000000..253818ccf9 --- /dev/null +++ b/tests/security/open_basedir_mkdir.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [mkdir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: mkdir(): open_basedir restriction in effect. File(../bad/blah) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: mkdir(): open_basedir restriction in effect. File(../blah) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: mkdir(): open_basedir restriction in effect. File(../bad/./blah) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: mkdir(): open_basedir restriction in effect. File(./.././blah) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [mkdir] *** diff --git a/tests/security/open_basedir_opendir.phpt b/tests/security/open_basedir_opendir.phpt new file mode 100644 index 0000000000..077a5116b4 --- /dev/null +++ b/tests/security/open_basedir_opendir.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [opendir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: opendir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(../bad): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(..): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(../): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(/): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(../bad/.): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(%s/test/bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) + +Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: opendir(%s/test/bad/../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d +bool(false) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +*** Finished testing open_basedir configuration [opendir] *** + diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt new file mode 100644 index 0000000000..ac740f073b --- /dev/null +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -0,0 +1,82 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [parse_ini_file] *** +bool(true) +bool(true) +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(%s\test\bad): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test\bad\bad.txt): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test\bad): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test\bad\bad.txt): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} + +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(%s\test): failed to open stream: Operation not permitted in %s on line %d +array(0) { +} +*** Finished testing open_basedir configuration [parse_ini_file] *** + diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt new file mode 100644 index 0000000000..cbba4307e5 --- /dev/null +++ b/tests/security/open_basedir_readlink.phpt @@ -0,0 +1,76 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [readlink] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: readlink(): open_basedir restriction in effect. File(symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: readlink(): open_basedir restriction in effect. File(../ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: readlink(): open_basedir restriction in effect. File(../ok/./symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: readlink(): open_basedir restriction in effect. File(./symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [readlink] *** + diff --git a/tests/security/open_basedir_realpath.phpt b/tests/security/open_basedir_realpath.phpt new file mode 100644 index 0000000000..8cae890e99 --- /dev/null +++ b/tests/security/open_basedir_realpath.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [realpath] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +bool(false) +string(%d) "%s\test\ok" +string(%d) "%s\test\ok\ok.txt" +string(%d) "%s\test\ok\ok.txt" +string(%d) "%s\test\ok\ok.txt" +string(%d) "%s\test\ok\ok.txt" +*** Finished testing open_basedir configuration [realpath] *** + diff --git a/tests/security/open_basedir_rename.phpt b/tests/security/open_basedir_rename.phpt new file mode 100644 index 0000000000..428e7a070a --- /dev/null +++ b/tests/security/open_basedir_rename.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [rename] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: rename(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rename(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rename(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rename(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rename(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [rename] *** + diff --git a/tests/security/open_basedir_rmdir.phpt b/tests/security/open_basedir_rmdir.phpt new file mode 100644 index 0000000000..b4d61f8b76 --- /dev/null +++ b/tests/security/open_basedir_rmdir.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [rmdir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: rmdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rmdir(): open_basedir restriction in effect. File(.././bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rmdir(): open_basedir restriction in effect. File(../bad/../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rmdir(): open_basedir restriction in effect. File(./.././bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: rmdir(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) +*** Finished testing open_basedir configuration [rmdir] *** + diff --git a/tests/security/open_basedir_scandir.phpt b/tests/security/open_basedir_scandir.phpt new file mode 100644 index 0000000000..a997bb993f --- /dev/null +++ b/tests/security/open_basedir_scandir.phpt @@ -0,0 +1,110 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [scandir] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: scandir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(../bad): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(..): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line 80 + +Warning: scandir(../): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(/): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(../bad/.): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(%s/test/bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) + +Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d + +Warning: scandir(%s/test/bad/../bad/bad.txt): failed to open dir: Operation not permitted in %s on line %d + +Warning: scandir(): (errno 1): Operation not permitted in %s on line %d +bool(false) +array(3) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(6) "ok.txt" +} +array(3) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(6) "ok.txt" +} +array(3) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(6) "ok.txt" +} +*** Finished testing open_basedir configuration [scandir] *** + diff --git a/tests/security/open_basedir_stat.phpt b/tests/security/open_basedir_stat.phpt new file mode 100644 index 0000000000..b80b854d6c --- /dev/null +++ b/tests/security/open_basedir_stat.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [stat] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: stat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: stat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [stat] *** + diff --git a/tests/security/open_basedir_symlink.phpt b/tests/security/open_basedir_symlink.phpt new file mode 100644 index 0000000000..3b3f1d571f --- /dev/null +++ b/tests/security/open_basedir_symlink.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- + +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [symlink] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [symlink] *** + diff --git a/tests/security/open_basedir_tempnam.phpt b/tests/security/open_basedir_tempnam.phpt new file mode 100644 index 0000000000..247ac88d5b --- /dev/null +++ b/tests/security/open_basedir_tempnam.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [tempnam] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: tempnam(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: tempnam(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: tempnam(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: tempnam(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: tempnam(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: tempnam(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +string(%d) "%s" +bool(true) +*** Finished testing open_basedir configuration [tempnam] *** + diff --git a/tests/security/open_basedir_touch.phpt b/tests/security/open_basedir_touch.phpt new file mode 100644 index 0000000000..b0a5aee612 --- /dev/null +++ b/tests/security/open_basedir_touch.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [touch] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: touch(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: touch(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +*** Finished testing open_basedir configuration [touch] *** + diff --git a/tests/security/open_basedir_unlink.phpt b/tests/security/open_basedir_unlink.phpt new file mode 100644 index 0000000000..75b0f3f4a9 --- /dev/null +++ b/tests/security/open_basedir_unlink.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing open_basedir configuration [unlink] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Warning: unlink(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: unlink(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: unlink(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +Warning: unlink(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d +bool(false) + +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 +bool(false) +*** Finished testing open_basedir configuration [unlink] *** + -- cgit v1.2.1