cvs: php-src /ext/standard/tests/dir open_basedir.inc open_basedir_dir.phpt open_basedir_opendir.phpt open_basedir_scandir.phpt
/ext/standard/tests/file open_basedir.inc open_basedir_chdir.phpt open_basedir_chmod.phpt open_basedir_copy.phpt open_basedir_copy_variation1.phpt
open_basedir_disk_free_space.phpt open_basedir_file.phpt open_basedir_file_exists.phpt open_basedir_file_get_contents.phpt
open_basedir_file_put_contents.phpt open_basedir_fileatime.phpt open_basedir_filectime.phpt open_basedir_filegroup.phpt open_basedir_fileinode.phpt
open_basedir_filemtime.phpt open_basedir_fileowner.phpt open_basedir_fileperms.phpt open_basedir_filesize.phpt open_basedir_filetype.phpt
open_basedir_fopen.phpt open_basedir_glob-win32.phpt open_basedir_glob.phpt open_basedir_is_dir.phpt open_basedir_is_executable.phpt
open_basedir_is_file.phpt open_basedir_is_link.phpt open_basedir_is_readable.phpt open_basedir_is_writable.phpt open_basedir_link.phpt
open_basedir_linkinfo.phpt ! open_basedir_lstat.phpt open_basedir_mkdir.phpt open_basedir_parse_ini_file.phpt open_basedir_readlink.phpt
open_basedir_realpath.phpt open_basedir_rename.phpt open_basedir_rmdir.phpt open_basedir_stat.phpt open_basedir_symlink.phpt open_basedir_tempnam.phpt
open_basedir_touch.phpt open_basedir_unlink.phpt /tests/security open_basedir.inc open_basedir_chdir.phpt open_basedir_chmod.phpt
open_basedir_copy.phpt open_basedir_copy_variation1.phpt open_basedir_dir.phpt open_basedir_disk_free_space.phpt open_basedir_error_log.phpt
open_basedir_error_log_variation.phpt open_basedir_file.phpt open_basedir_file_exists.phpt open_basedir_file_get_contents.phpt
open_basedir_file_put_contents.phpt open_basedir_fileatime.phpt open_basedir_filectime.phpt open_basedir_filegroup.phpt open_basedir_fileinode.phpt
open_basedir_filemtime.phpt open_basedir_fileowner.phpt open_basedir_fileperms.phpt open_basedir_filesize.phpt open_basedir_filetype.phpt
open_basedir_fopen.phpt open_basedir_glob-wi! n32.phpt open_basedir_glob.phpt open_basedir_is_dir.phpt open_basedir_is_executable.phpt
open_basedir_is_file.phpt open_basedir_is_link.phpt open_basedir_is_readable.phpt open_basedir_is_writable.phpt open_basedir_link.phpt
open_basedir_linkinfo.phpt open_basedir_lstat.phpt open_basedir_mkdir.phpt open_basedir_opendir.phpt o

From: Date: Fri, 09 May 2008 08:44:44 +0000
Subject: cvs: php-src /ext/standard/tests/dir open_basedir.inc open_basedir_dir.phpt open_basedir_opendir.phpt open_basedir_scandir.phpt
/ext/standard/tests/file open_basedir.inc open_basedir_chdir.phpt open_basedir_chmod.phpt open_basedir_copy.phpt open_basedir_copy_variation1.phpt
open_basedir_disk_free_space.phpt open_basedir_file.phpt open_basedir_file_exists.phpt open_basedir_file_get_contents.phpt
open_basedir_file_put_contents.phpt open_basedir_fileatime.phpt open_basedir_filectime.phpt open_basedir_filegroup.phpt open_basedir_fileinode.phpt
open_basedir_filemtime.phpt open_basedir_fileowner.phpt open_basedir_fileperms.phpt open_basedir_filesize.phpt open_basedir_filetype.phpt
open_basedir_fopen.phpt open_basedir_glob-win32.phpt open_basedir_glob.phpt open_basedir_is_dir.phpt open_basedir_is_executable.phpt
open_basedir_is_file.phpt open_basedir_is_link.phpt open_basedir_is_readable.phpt open_basedir_is_writable.phpt open_basedir_link.phpt
open_basedir_linkinfo.phpt ! open_basedir_lstat.phpt open_basedir_mkdir.phpt open_basedir_parse_ini_file.phpt open_basedir_readlink.phpt
open_basedir_realpath.phpt open_basedir_rename.phpt open_basedir_rmdir.phpt open_basedir_stat.phpt open_basedir_symlink.phpt open_basedir_tempnam.phpt
open_basedir_touch.phpt open_basedir_unlink.phpt /tests/security open_basedir.inc open_basedir_chdir.phpt open_basedir_chmod.phpt
open_basedir_copy.phpt open_basedir_copy_variation1.phpt open_basedir_dir.phpt open_basedir_disk_free_space.phpt open_basedir_error_log.phpt
open_basedir_error_log_variation.phpt open_basedir_file.phpt open_basedir_file_exists.phpt open_basedir_file_get_contents.phpt
open_basedir_file_put_contents.phpt open_basedir_fileatime.phpt open_basedir_filectime.phpt open_basedir_filegroup.phpt open_basedir_fileinode.phpt
open_basedir_filemtime.phpt open_basedir_fileowner.phpt open_basedir_fileperms.phpt open_basedir_filesize.phpt open_basedir_filetype.phpt
open_basedir_fopen.phpt open_basedir_glob-wi! n32.phpt open_basedir_glob.phpt open_basedir_is_dir.phpt open_basedir_is_executable.phpt
open_basedir_is_file.phpt open_basedir_is_link.phpt open_basedir_is_readable.phpt open_basedir_is_writable.phpt open_basedir_link.phpt
open_basedir_linkinfo.phpt open_basedir_lstat.phpt open_basedir_mkdir.phpt open_basedir_opendir.phpt o
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-49914@lists.php.net to get a copy of this message
ant Fri May 9 08:44:44 2008 UTC Removed files: /php-src/ext/standard/tests/dir open_basedir_scandir.phpt open_basedir.inc open_basedir_opendir.phpt open_basedir_dir.phpt /php-src/ext/standard/tests/file open_basedir_fopen.phpt open_basedir_filemtime.phpt open_basedir.inc open_basedir_filetype.phpt open_basedir_fileatime.phpt open_basedir_mkdir.phpt open_basedir_glob.phpt open_basedir_filectime.phpt open_basedir_chmod.phpt open_basedir_glob-win32.phpt open_basedir_is_readable.phpt open_basedir_file_get_contents.phpt open_basedir_disk_free_space.phpt open_basedir_is_file.phpt open_basedir_link.phpt open_basedir_filegroup.phpt open_basedir_stat.phpt open_basedir_fileperms.phpt open_basedir_linkinfo.phpt open_basedir_file_exists.phpt open_basedir_lstat.phpt open_basedir_fileinode.phpt open_basedir_tempnam.phpt open_basedir_is_link.phpt open_basedir_file.phpt open_basedir_realpath.phpt open_basedir_rmdir.phpt open_basedir_chdir.phpt open_basedir_is_dir.phpt open_basedir_is_writable.phpt open_basedir_touch.phpt open_basedir_filesize.phpt open_basedir_copy.phpt open_basedir_parse_ini_file.phpt open_basedir_copy_variation1.phpt open_basedir_rename.phpt open_basedir_symlink.phpt open_basedir_readlink.phpt open_basedir_unlink.phpt open_basedir_file_put_contents.phpt open_basedir_is_executable.phpt open_basedir_fileowner.phpt Modified files: /php-src/tests/security open_basedir_rmdir.phpt open_basedir_opendir.phpt open_basedir_mkdir.phpt open_basedir_fopen.phpt open_basedir_filesize.phpt open_basedir_fileinode.phpt open_basedir_glob.phpt open_basedir_filegroup.phpt open_basedir_stat.phpt open_basedir_fileperms.phpt open_basedir_is_file.phpt open_basedir_symlink.phpt open_basedir_parse_ini_file.phpt open_basedir_disk_free_space.phpt open_basedir_file_exists.phpt open_basedir_copy.phpt open_basedir_lstat.phpt open_basedir_file_get_contents.phpt open_basedir_is_link.phpt open_basedir_file.phpt open_basedir_scandir.phpt open_basedir_filemtime.phpt open_basedir_error_log_variation.phpt open_basedir_filetype.phpt open_basedir_unlink.phpt open_basedir_file_put_contents.phpt open_basedir_chmod.phpt open_basedir.inc open_basedir_is_writable.phpt open_basedir_glob-win32.phpt open_basedir_is_dir.phpt open_basedir_error_log.phpt open_basedir_fileowner.phpt open_basedir_touch.phpt open_basedir_tempnam.phpt open_basedir_dir.phpt open_basedir_copy_variation1.phpt open_basedir_linkinfo.phpt open_basedir_readlink.phpt open_basedir_is_executable.phpt open_basedir_is_readable.phpt open_basedir_filectime.phpt open_basedir_fileatime.phpt open_basedir_rename.phpt open_basedir_chdir.phpt open_basedir_realpath.phpt open_basedir_link.phpt Log: Collect all the open_basedir security tests into one place

http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_rmdir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_rmdir.phpt diff -u /dev/null php-src/tests/security/open_basedir_rmdir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_rmdir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("rmdir"); +$directory = dirname(__FILE__); + +var_dump(rmdir("../bad")); +var_dump(rmdir(".././bad")); +var_dump(rmdir("../bad/../bad")); +var_dump(rmdir("./.././bad")); +var_dump(rmdir($directory."/test/bad")); + +test_open_basedir_after("rmdir"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_opendir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_opendir.phpt diff -u /dev/null php-src/tests/security/open_basedir_opendir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_opendir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,73 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("opendir"); +test_open_basedir_error("opendir"); + +$directory = dirname(__FILE__); +var_dump(opendir($directory."/test/ok/")); +var_dump(opendir($directory."/test/ok")); +var_dump(opendir($directory."/test/ok/../ok")); + +test_open_basedir_after("opendir");?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_mkdir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_mkdir.phpt diff -u /dev/null php-src/tests/security/open_basedir_mkdir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_mkdir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,52 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip Windows only variation'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("mkdir"); +$directory = dirname(__FILE__); + +var_dump(mkdir("../bad/blah")); +var_dump(mkdir("../blah")); +var_dump(mkdir("../bad/./blah")); +var_dump(mkdir("./.././blah")); + +var_dump(mkdir($directory."/test/ok/blah")); +var_dump(rmdir($directory."/test/ok/blah")); +test_open_basedir_after("mkdir"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_fopen.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_fopen.phpt diff -u /dev/null php-src/tests/security/open_basedir_fopen.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_fopen.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,86 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("fopen"); +$directory = dirname(__FILE__); + +var_dump(fopen("../bad", "r")); +var_dump(fopen("../bad/bad.txt", "r")); +var_dump(fopen("..", "r")); +var_dump(fopen("../", "r")); +var_dump(fopen("/", "r")); +var_dump(fopen("../bad/.", "r")); +var_dump(fopen("../bad/./bad.txt", "r")); +var_dump(fopen("./../.", "r")); + +var_dump(fopen($directory."/test/ok/ok.txt", "r")); +var_dump(fopen("./ok.txt", "r")); +var_dump(fopen("ok.txt", "r")); +var_dump(fopen("../ok/ok.txt", "r")); +var_dump(fopen("../ok/./ok.txt", "r")); + +test_open_basedir_after("fopen"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_filesize.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_filesize.phpt diff -u /dev/null php-src/tests/security/open_basedir_filesize.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_filesize.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("filesize"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_fileinode.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_fileinode.phpt diff -u /dev/null php-src/tests/security/open_basedir_fileinode.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_fileinode.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("fileinode"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_glob.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_glob.phpt diff -u /dev/null php-src/tests/security/open_basedir_glob.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_glob.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,95 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip Not for Windows variation'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("glob"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--EXPECTF-- +*** Testing open_basedir configuration [glob] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +bool(false) +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] *** +--UEXPECTF-- +*** 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]=> + unicode(5) "../ok" +} +array(1) { + [0]=> + unicode(6) "ok.txt" +} +array(1) { + [0]=> + unicode(12) "../ok/ok.txt" +} +array(1) { + [0]=> + unicode(%d) "%s/test/ok/ok.txt" +} +array(1) { + [0]=> + unicode(%d) "%s/test/ok/../ok/ok.txt" +} +*** Finished testing open_basedir configuration [glob] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_filegroup.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_filegroup.phpt diff -u /dev/null php-src/tests/security/open_basedir_filegroup.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_filegroup.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("filegroup"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_stat.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_stat.phpt diff -u /dev/null php-src/tests/security/open_basedir_stat.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_stat.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_array("stat"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_fileperms.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_fileperms.phpt diff -u /dev/null php-src/tests/security/open_basedir_fileperms.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_fileperms.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("fileperms"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_file.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_file.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_file.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_file.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("is_file"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_symlink.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_symlink.phpt diff -u /dev/null php-src/tests/security/open_basedir_symlink.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_symlink.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,78 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip no symlinks on Windows'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("symlink"); +$directory = dirname(__FILE__); + +$target = ($directory."/test/ok/ok.txt"); +var_dump(symlink($target, "../bad/symlink.txt")); +var_dump(symlink($target, "../symlink.txt")); +var_dump(symlink($target, "../bad/./symlink.txt")); +var_dump(symlink($target, "./.././symlink.txt")); + +$symlink = ($directory."/test/ok/symlink.txt"); +var_dump(symlink("../bad/bad.txt", $symlink)); +var_dump(symlink("../bad", $symlink)); +var_dump(symlink("../bad/./bad.txt", $symlink)); +var_dump(symlink("../bad/bad.txt", $symlink)); +var_dump(symlink("./.././bad", $symlink)); + +$target = ($directory."/test/ok/ok.txt"); + +var_dump(symlink($target, $symlink)); +var_dump(unlink($symlink)); +test_open_basedir_after("symlink"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_parse_ini_file.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_parse_ini_file.phpt diff -u /dev/null php-src/tests/security/open_basedir_parse_ini_file.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_parse_ini_file.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,82 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip Windows only variation'); +} +?> +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("parse_ini_file"); +$directory = dirname(__FILE__); + +var_dump(parse_ini_file("../bad")); +var_dump(parse_ini_file("../bad/bad.txt")); +var_dump(parse_ini_file("..")); +var_dump(parse_ini_file("../")); +var_dump(parse_ini_file("../bad/.")); +var_dump(parse_ini_file("../bad/./bad.txt")); +var_dump(parse_ini_file("./../.")); + +test_open_basedir_after("parse_ini_file"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_disk_free_space.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_disk_free_space.phpt diff -u /dev/null php-src/tests/security/open_basedir_disk_free_space.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_disk_free_space.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,52 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; + +test_open_basedir_before("disk_free_space"); +test_open_basedir_error("disk_free_space"); +$directory = dirname(__FILE__); +var_dump(disk_free_space($directory."/test/ok")); +test_open_basedir_after("disk_free_space"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_file_exists.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_file_exists.phpt diff -u /dev/null php-src/tests/security/open_basedir_file_exists.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_file_exists.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("file_exists"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_copy.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_copy.phpt diff -u /dev/null php-src/tests/security/open_basedir_copy.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_copy.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,79 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("copy"); +$directory = dirname(__FILE__); + +var_dump(copy("ok.txt", "../bad")); +var_dump(copy("ok.txt", "../bad/bad.txt")); +var_dump(copy("ok.txt", "..")); +var_dump(copy("ok.txt", "../")); +var_dump(copy("ok.txt", "/")); +var_dump(copy("ok.txt", "../bad/.")); +var_dump(copy("ok.txt", "../bad/./bad.txt")); +var_dump(copy("ok.txt", "./../.")); + +var_dump(copy("ok.txt", "copy.txt")); +var_dump(unlink("copy.txt")); +test_open_basedir_after("copy"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_lstat.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_lstat.phpt diff -u /dev/null php-src/tests/security/open_basedir_lstat.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_lstat.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_array("lstat"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_file_get_contents.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_file_get_contents.phpt diff -u /dev/null php-src/tests/security/open_basedir_file_get_contents.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_file_get_contents.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,75 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +$directory = dirname(__FILE__); +test_open_basedir_before("file_get_contents"); +test_open_basedir_error("file_get_contents"); + +var_dump(file_get_contents("ok.txt")); +var_dump(file_get_contents("../ok/ok.txt")); +var_dump(file_get_contents($directory."/test/ok/ok.txt")); +var_dump(file_get_contents($directory."/test/ok/../ok/ok.txt")); + +test_open_basedir_after("file_get_contents"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_link.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_link.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_link.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_link.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("is_link"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_file.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_file.phpt diff -u /dev/null php-src/tests/security/open_basedir_file.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_file.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,88 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +$directory = dirname(__FILE__); +test_open_basedir_before("file"); +test_open_basedir_error("file"); + +var_dump(file("ok.txt")); +var_dump(file("../ok/ok.txt")); +var_dump(file($directory."/test/ok/ok.txt")); +var_dump(file($directory."/test/ok/../ok/ok.txt")); + +test_open_basedir_after("file"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_scandir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_scandir.phpt diff -u /dev/null php-src/tests/security/open_basedir_scandir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_scandir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,198 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("scandir"); +test_open_basedir_error("scandir"); + +$directory = dirname(__FILE__); +var_dump(scandir($directory."/test/ok/")); +var_dump(scandir($directory."/test/ok")); +var_dump(scandir($directory."/test/ok/../ok")); + +test_open_basedir_after("scandir");?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +--UEXPECTF-- +*** 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]=> + unicode(1) "." + [1]=> + unicode(2) ".." + [2]=> + unicode(6) "ok.txt" +} +array(3) { + [0]=> + unicode(1) "." + [1]=> + unicode(2) ".." + [2]=> + unicode(6) "ok.txt" +} +array(3) { + [0]=> + unicode(1) "." + [1]=> + unicode(2) ".." + [2]=> + unicode(6) "ok.txt" +} +*** Finished testing open_basedir configuration [scandir] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_filemtime.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_filemtime.phpt diff -u /dev/null php-src/tests/security/open_basedir_filemtime.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_filemtime.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("filemtime"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_error_log_variation.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_error_log_variation.phpt diff -u /dev/null php-src/tests/security/open_basedir_error_log_variation.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_error_log_variation.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,48 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("error_log"); +$directory = dirname(__FILE__); +define("DESTINATION_IS_FILE", 3); + +var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $directory."/test/bad/bad.txt")); +var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $directory."/test/bad.txt")); +var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $directory."/bad.txt")); +var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $directory."/test/ok/ok.txt")); + +test_open_basedir_after("error_log"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_filetype.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_filetype.phpt diff -u /dev/null php-src/tests/security/open_basedir_filetype.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_filetype.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,95 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("filetype"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +--UEXPECTF-- +*** 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) +unicode(3) "dir" +unicode(4) "file" +unicode(4) "file" +unicode(4) "file" +unicode(4) "file" +*** Finished testing open_basedir configuration [filetype] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_unlink.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_unlink.phpt diff -u /dev/null php-src/tests/security/open_basedir_unlink.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_unlink.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("unlink"); +$directory = dirname(__FILE__); + +var_dump(unlink("../bad/bad.txt")); +var_dump(unlink(".././bad/bad.txt")); +var_dump(unlink("../bad/../bad/bad.txt")); +var_dump(unlink("./.././bad/bad.txt")); +var_dump(unlink($directory."/test/bad/bad.txt")); + +test_open_basedir_after("unlink"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_file_put_contents.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_file_put_contents.phpt diff -u /dev/null php-src/tests/security/open_basedir_file_put_contents.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_file_put_contents.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,57 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("file_put_contents"); +$directory = dirname(__FILE__); + +var_dump(file_put_contents("../bad/bad.txt", "Hello World!")); +var_dump(file_put_contents(".././bad/bad.txt", "Hello World!")); +var_dump(file_put_contents("../bad/../bad/bad.txt", "Hello World!")); +var_dump(file_put_contents("./.././bad/bad.txt", "Hello World!")); +var_dump(file_put_contents($directory."/test/bad/bad.txt", "Hello World!")); + +test_open_basedir_after("file_put_contents"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_chmod.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_chmod.phpt diff -u /dev/null php-src/tests/security/open_basedir_chmod.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_chmod.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,71 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("chmod"); +$directory = dirname(__FILE__); + +var_dump(chmod("../bad", 0600)); +var_dump(chmod("../bad/bad.txt", 0600)); +var_dump(chmod("..", 0600)); +var_dump(chmod("../", 0600)); +var_dump(chmod("/", 0600)); +var_dump(chmod("../bad/.", 0600)); +var_dump(chmod("../bad/./bad.txt", 0600)); +var_dump(chmod("./../.", 0600)); + +var_dump(chmod($directory."/test/ok/ok.txt", 0600)); +var_dump(chmod("./ok.txt", 0600)); +var_dump(chmod("ok.txt", 0600)); +var_dump(chmod("../ok/ok.txt", 0600)); +var_dump(chmod("../ok/./ok.txt", 0600)); +chmod($directory."/test/ok/ok.txt", 0777); + +test_open_basedir_after("chmod"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir.inc?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir.inc diff -u /dev/null php-src/tests/security/open_basedir.inc:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir.inc Fri May 9 08:44:43 2008 @@ -0,0 +1,133 @@ +<?php + +// This file contains helper functions for testing open_basedir configuration +// Care must be taken with where the directories are created because different +// SAPIs set the working directory differently. So simply creating a directory +// relative to the current working directory like this: mkdir("blah") might +// actually create it in several different places depending on the SAPI..! +// +// Note also depending on the version of php being tested, so the open_basedir +// configuration may or may not be changeable from a script (PHP_INI_SYSTEM). +// +// For this reason we set the open_basedir to . (current directory) and then +// move around to various directories for testing using chdir(). This is NOT +// recommended for production use as . bypasses all semblence of security..! +// +// Although safe mode has been removed in php 6.0, open_basedir is still valid. +// See http://www.php.net/features.safe-mode for more information + +function recursive_delete_directory($directory) { + + // Remove any trailing slash first + if (substr($directory, -1) == '/') { + $directory = substr($directory, 0, -1); + } + + // Make sure the directory is valid + if (is_dir($directory) == FALSE) { + return FALSE; + } + + // Check we can access the directory + if (is_readable($directory) == FALSE) { + return FALSE; + } + + $handle = opendir($directory); + + // Scan through the directory contents + while (FALSE !== ($item = readdir($handle))) { + if ($item != '.') { + if ($item != '..') { + $path = ($directory.'/'.$item); + if (is_dir($path) == TRUE) { + recursive_delete_directory($path); + } else { + @chmod($path, 0777); + unlink($path); + } + } + } + } + + closedir($handle); + @chmod($directory, 0777); + rmdir($directory); + + return TRUE; +} + +function create_directories() { + delete_directories(); + $directory = dirname(__FILE__); + + var_dump(mkdir($directory."/test")); + var_dump(mkdir($directory."/test/ok")); + var_dump(mkdir($directory."/test/bad")); + file_put_contents($directory."/test/ok/ok.txt", "Hello World!"); + file_put_contents($directory."/test/bad/bad.txt", "Hello World!"); +} + +function delete_directories() { + $directory = (dirname(__FILE__)."/test"); + recursive_delete_directory($directory); +} + +function test_open_basedir_error($function) { + var_dump($function("../bad")); + var_dump($function("../bad/bad.txt")); + var_dump($function("..")); + var_dump($function("../")); + var_dump($function("/")); + var_dump($function("../bad/.")); + $directory = dirname(__FILE__); + var_dump($function($directory."/test/bad/bad.txt")); + var_dump($function($directory."/test/bad/../bad/bad.txt")); +} + +function test_open_basedir_before($function, $change = TRUE) { + echo "*** Testing open_basedir configuration [$function] ***\n"; + $directory = dirname(__FILE__); + var_dump(chdir($directory)); + create_directories(); + + // Optionally change directory + if ($change == TRUE) { + var_dump(chdir($directory."/test/ok")); + } +} + +// Delete directories using a --CLEAN-- section! +function test_open_basedir_after($function) { + echo "*** Finished testing open_basedir configuration [$function] ***\n"; +} + +// This is used by functions that return an array on success +function test_open_basedir_array($function) { + test_open_basedir_before($function); + test_open_basedir_error($function); + var_dump(is_array($function("./../."))); + var_dump(is_array($function("../ok"))); + var_dump(is_array($function("ok.txt"))); + var_dump(is_array($function("../ok/ok.txt"))); + $directory = dirname(__FILE__); + var_dump(is_array($function($directory."/test/ok/ok.txt"))); + var_dump(is_array($function($directory."/test/ok/../ok/ok.txt"))); + test_open_basedir_after($function); +} + +function test_open_basedir($function) { + test_open_basedir_before($function); + test_open_basedir_error($function); + var_dump($function("./../.")); + var_dump($function("../ok")); + var_dump($function("ok.txt")); + var_dump($function("../ok/ok.txt")); + $directory = dirname(__FILE__); + var_dump($function($directory."/test/ok/ok.txt")); + var_dump($function($directory."/test/ok/../ok/ok.txt")); + test_open_basedir_after($function); +} + +?> + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_writable.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_writable.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_writable.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_writable.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("is_writable"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_glob-win32.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_glob-win32.phpt diff -u /dev/null php-src/tests/security/open_basedir_glob-win32.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_glob-win32.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,97 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip Windows only variation'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("glob"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--EXPECTF-- +*** Testing open_basedir configuration [glob] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +bool(false) +array(0) { +} +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +array(1) { + [0]=> + string(5) "../ok" +} +array(1) { + [0]=> + string(6) "ok.txt" +} +array(1) { + [0]=> + string(12) "../ok/ok.txt" +} +array(1) { + [0]=> + string(%d) "%s/test/ok/ok.txt" +} +array(1) { + [0]=> + string(%d) "%s/test/ok/../ok/ok.txt" +} +*** Finished testing open_basedir configuration [glob] *** +--UEXPECTF-- +*** 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]=> + unicode(5) "../ok" +} +array(1) { + [0]=> + unicode(6) "ok.txt" +} +array(1) { + [0]=> + unicode(12) "../ok/ok.txt" +} +array(1) { + [0]=> + unicode(%d) "%s/test/ok/ok.txt" +} +array(1) { + [0]=> + unicode(%d) "%s/test/ok/../ok/ok.txt" +} +*** Finished testing open_basedir configuration [glob] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_dir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_dir.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_dir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_dir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("is_dir"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_error_log.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_error_log.phpt diff -u /dev/null php-src/tests/security/open_basedir_error_log.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_error_log.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,62 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("error_log"); +$directory = dirname(__FILE__); + +var_dump(ini_set("error_log", $directory."/test/bad/bad.txt")); +var_dump(ini_set("error_log", $directory."/test/bad.txt")); +var_dump(ini_set("error_log", $directory."/bad.txt")); +var_dump(ini_set("error_log", $directory."/test/ok/ok.txt")); +var_dump(ini_set("error_log", $directory."/test/ok/ok.txt")); + +test_open_basedir_after("error_log"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +--UEXPECTF-- +*** 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) +unicode(0) "" +unicode(%d) "%s/test/ok/ok.txt" +*** Finished testing open_basedir configuration [error_log] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_fileowner.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_fileowner.phpt diff -u /dev/null php-src/tests/security/open_basedir_fileowner.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_fileowner.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("fileowner"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_touch.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_touch.phpt diff -u /dev/null php-src/tests/security/open_basedir_touch.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_touch.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,70 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("touch"); +$directory = dirname(__FILE__); + +var_dump(touch("../bad")); +var_dump(touch("../bad/bad.txt")); +var_dump(touch("..")); +var_dump(touch("../")); +var_dump(touch("/")); +var_dump(touch("../bad/.")); +var_dump(touch("../bad/./bad.txt")); +var_dump(touch("./../.")); + +var_dump(touch($directory."/test/ok/ok.txt")); +var_dump(touch("./ok.txt")); +var_dump(touch("ok.txt")); +var_dump(touch("../ok/ok.txt")); +var_dump(touch("../ok/./ok.txt")); + +test_open_basedir_after("touch"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_tempnam.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_tempnam.phpt diff -u /dev/null php-src/tests/security/open_basedir_tempnam.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_tempnam.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,85 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("tempnam"); +$directory = dirname(__FILE__); + +var_dump(tempnam("../bad", "test")); +var_dump(tempnam("..", "test")); +var_dump(tempnam("../", "test")); +var_dump(tempnam("/", "test")); +var_dump(tempnam("../bad/.", "test")); +var_dump(tempnam("./../.", "test")); + +$file = tempnam($directory."/test/ok", "test"); +var_dump($file); +var_dump(unlink($file)); + +test_open_basedir_after("tempnam"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +--UEXPECTF-- +*** 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) +unicode(%d) "%s" +bool(true) +*** Finished testing open_basedir configuration [tempnam] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_dir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_dir.phpt diff -u /dev/null php-src/tests/security/open_basedir_dir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_dir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,154 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("dir"); +test_open_basedir_error("dir"); + +$directory = dirname(__FILE__); +var_dump(dir($directory."/test/ok/")); +var_dump(dir($directory."/test/ok")); +var_dump(dir($directory."/test/ok/../ok")); + +test_open_basedir_after("dir");?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +--UEXPECTF-- +*** 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) { + [u"path"]=> + unicode(%d) "%s/test/ok/" + [u"handle"]=> + resource(%d) of type (stream) +} +object(Directory)#%d (2) { + [u"path"]=> + unicode(%d) "%s/test/ok" + [u"handle"]=> + resource(%d) of type (stream) +} +object(Directory)#%d (2) { + [u"path"]=> + unicode(%d) "%s/test/ok/../ok" + [u"handle"]=> + resource(%d) of type (stream) +} +*** Finished testing open_basedir configuration [dir] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_copy_variation1.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_copy_variation1.phpt diff -u /dev/null php-src/tests/security/open_basedir_copy_variation1.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_copy_variation1.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,35 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("copy"); +$directory = dirname(__FILE__); + +var_dump(copy("../bad/bad.txt", "copy.txt")); +var_dump(unlink("copy.txt")); + +test_open_basedir_after("copy"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_linkinfo.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_linkinfo.phpt diff -u /dev/null php-src/tests/security/open_basedir_linkinfo.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_linkinfo.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,64 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip no symlinks on Windows'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("linkinfo", FALSE); +$directory = dirname(__FILE__); + +chdir($directory); + +$target = ($directory."/test/bad/bad.txt"); +$symlink = ($directory."/test/ok/symlink.txt"); +var_dump(symlink($target, $symlink)); + +chdir($directory."/test/ok"); + +var_dump(linkinfo("symlink.txt")); +var_dump(linkinfo("../ok/symlink.txt")); +var_dump(linkinfo("../ok/./symlink.txt")); +var_dump(linkinfo("./symlink.txt")); +var_dump(linkinfo($directory."/test/ok/symlink.txt")); + +$target = ($directory."/test/ok/ok.txt"); +$symlink = ($directory."/test/ok/symlink.txt"); +var_dump(symlink($target, $symlink)); +var_dump(linkinfo($symlink)); +var_dump(unlink($symlink)); + +test_open_basedir_after("linkinfo"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_readlink.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_readlink.phpt diff -u /dev/null php-src/tests/security/open_basedir_readlink.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_readlink.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,76 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip no symlinks on Windows'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("readlink", FALSE); +$directory = dirname(__FILE__); + +chdir($directory); + +$target = ($directory."/test/bad/bad.txt"); +$symlink = ($directory."/test/ok/symlink.txt"); +var_dump(symlink($target, $symlink)); + +chdir($directory."/test/ok"); + +var_dump(readlink("symlink.txt")); +var_dump(readlink("../ok/symlink.txt")); +var_dump(readlink("../ok/./symlink.txt")); +var_dump(readlink("./symlink.txt")); +var_dump(readlink($directory."/test/ok/symlink.txt")); + +$target = ($directory."/test/ok/ok.txt"); +$symlink = ($directory."/test/ok/symlink.txt"); +var_dump(symlink($target, $symlink)); +var_dump(readlink($symlink)); +var_dump(unlink($symlink)); + +test_open_basedir_after("readlink"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_executable.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_executable.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_executable.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_executable.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,59 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("is_executable"); +test_open_basedir_error("is_executable"); + +var_dump(is_executable("ok.txt")); +var_dump(is_executable("../ok/ok.txt")); +$directory = dirname(__FILE__); +var_dump(is_executable($directory."/test/ok/ok.txt")); +var_dump(is_executable($directory."/test/ok/../ok/ok.txt")); + +test_open_basedir_after("is_executable"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_is_readable.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_is_readable.phpt diff -u /dev/null php-src/tests/security/open_basedir_is_readable.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_is_readable.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("is_readable"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_filectime.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_filectime.phpt diff -u /dev/null php-src/tests/security/open_basedir_filectime.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_filectime.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("filectime"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_fileatime.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_fileatime.phpt diff -u /dev/null php-src/tests/security/open_basedir_fileatime.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_fileatime.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,55 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("fileatime"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_rename.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_rename.phpt diff -u /dev/null php-src/tests/security/open_basedir_rename.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_rename.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,47 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("rename"); +$directory = dirname(__FILE__); + +var_dump(rename("../bad/bad.txt", "rename.txt")); +var_dump(rename(".././bad/bad.txt", "rename.txt")); +var_dump(rename("../bad/../bad/bad.txt", "rename.txt")); +var_dump(rename("./.././bad/bad.txt", "rename.txt")); +var_dump(rename($directory."/test/bad/bad.txt", "rename.txt")); + +test_open_basedir_after("rename"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_chdir.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_chdir.phpt diff -u /dev/null php-src/tests/security/open_basedir_chdir.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_chdir.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,51 @@ +--TEST-- +Test open_basedir configuration +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("chdir"); +$directory = dirname(__FILE__); + +var_dump(chdir("../bad")); +var_dump(chdir("..")); +var_dump(chdir("../")); +var_dump(chdir("/")); +var_dump(chdir("../bad/.")); +var_dump(chdir("./../.")); + +test_open_basedir_after("chdir"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_realpath.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_realpath.phpt diff -u /dev/null php-src/tests/security/open_basedir_realpath.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_realpath.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,65 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip only run on Windows'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir("realpath"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--EXPECTF-- +*** Testing open_basedir configuration [realpath] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +string(%d) "%s\test\bad" +string(%d) "%s\test\bad\bad.txt" +string(%d) "%s\test" +string(%d) "%s\test" +string(%d) "%s" +string(%d) "%s\test\bad" +string(%d) "%s\test\bad\bad.txt" +string(%d) "%s\test\bad\bad.txt" +string(%d) "%s\test" +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] *** +--UEXPECTF-- +*** Testing open_basedir configuration [realpath] *** +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +unicode(%d) "%s\test\bad" +unicode(%d) "%s\test\bad\bad.txt" +unicode(%d) "%s\test" +unicode(%d) "%s\test" +unicode(%d) "%s" +unicode(%d) "%s\test\bad" +unicode(%d) "%s\test\bad\bad.txt" +unicode(%d) "%s\test\bad\bad.txt" +unicode(%d) "%s\test" +unicode(%d) "%s\test\ok" +unicode(%d) "%s\test\ok\ok.txt" +unicode(%d) "%s\test\ok\ok.txt" +unicode(%d) "%s\test\ok\ok.txt" +unicode(%d) "%s\test\ok\ok.txt" +*** Finished testing open_basedir configuration [realpath] *** + http://cvs.php.net/viewvc.cgi/php-src/tests/security/open_basedir_link.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/security/open_basedir_link.phpt diff -u /dev/null php-src/tests/security/open_basedir_link.phpt:1.2 --- /dev/null Fri May 9 08:44:44 2008 +++ php-src/tests/security/open_basedir_link.phpt Fri May 9 08:44:43 2008 @@ -0,0 +1,78 @@ +--TEST-- +Test open_basedir configuration +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip no links on Windows'); +} +?> +--INI-- +open_basedir=. +--FILE-- +<?php +require_once "open_basedir.inc"; +test_open_basedir_before("link"); +$directory = dirname(__FILE__); + +$target = ($directory."/test/ok/ok.txt"); +var_dump(link($target, "../bad/link.txt")); +var_dump(link($target, "../link.txt")); +var_dump(link($target, "../bad/./link.txt")); +var_dump(link($target, "./.././link.txt")); + +$link = ($directory."/test/ok/link.txt"); +var_dump(link("../bad/bad.txt", $link)); +var_dump(link("../bad", $link)); +var_dump(link("../bad/./bad.txt", $link)); +var_dump(link("../bad/bad.txt", $link)); +var_dump(link("./.././bad", $link)); + +$target = ($directory."/test/ok/ok.txt"); + +var_dump(link($target, $link)); +var_dump(unlink($link)); +test_open_basedir_after("link"); +?> +--CLEAN-- +<?php +require_once "open_basedir.inc"; +delete_directories(); +?> +--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] *** +
« previous php.cvs (#49914) next »