From f6b00dcf5b2bbc28d58a6086e292b729cb3a8ff1 Mon Sep 17 00:00:00 2001 From: Ant Phillips Date: Fri, 9 May 2008 08:33:55 +0000 Subject: open_basedir tests for error_log --- tests/security/open_basedir.inc | 133 +++++++++++++++++++++ tests/security/open_basedir_error_log.phpt | 43 +++++++ .../security/open_basedir_error_log_variation.phpt | 48 ++++++++ 3 files changed, 224 insertions(+) create mode 100644 tests/security/open_basedir.inc create mode 100644 tests/security/open_basedir_error_log.phpt create mode 100644 tests/security/open_basedir_error_log_variation.phpt (limited to 'tests') 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] *** + -- cgit v1.2.1