From: Ant Phillips Date: Fri, 9 May 2008 08:33:55 +0000 (+0000) Subject: open_basedir tests for error_log X-Git-Tag: RELEASE_1_2_5~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6b00dcf5b2bbc28d58a6086e292b729cb3a8ff1;p=php open_basedir tests for error_log --- 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_error_log.phpt b/tests/security/open_basedir_error_log.phpt new file mode 100644 index 0000000000..d4406505a9 --- /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) +bool(false) +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] *** +