php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45837 open_basedir failed for building outside of source tree
Submitted: 2008-08-17 03:28 UTC Modified: 2008-09-12 14:15 UTC
From: xuefer at gmail dot com Assigned:
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 5.3CVS ZTS OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: xuefer at gmail dot com
New email:
PHP Version: OS:

 

 [2008-08-17 03:28 UTC] xuefer at gmail dot com
Description:
------------
my php is built outside of the php source tree, i'm not sure if this is the reason as i haven't try to built php witin source tree yet. looks like most of the open_basedir* test failed

and btw tests/basic/bug20539.phpt also failed due to the same problem imho.

Reproduce code:
---------------
~/src/php5 $ cd ../php5-debug-zts
~/src/php5-debug-zts $ ../php5/configure ...
~/src/php5-debug-zts $ make && make test


Actual result:
--------------
Bug #20539 (PHP CLI Segmentation Fault) [tests/basic/bug20539.phpt]
Test open_basedir configuration [tests/security/open_basedir_chdir.phpt]
Test open_basedir configuration [tests/security/open_basedir_chmod.phpt]
Test open_basedir configuration [tests/security/open_basedir_copy.phpt]
Test open_basedir configuration [tests/security/open_basedir_copy_variation1.phpt]
Test open_basedir configuration [tests/security/open_basedir_dir.phpt]
Test open_basedir configuration [tests/security/open_basedir_disk_free_space.phpt]
Test open_basedir configuration [tests/security/open_basedir_error_log.phpt]
Test open_basedir configuration [tests/security/open_basedir_error_log_variation.phpt]
Test open_basedir configuration [tests/security/open_basedir_file.phpt]
Test open_basedir configuration [tests/security/open_basedir_file_exists.phpt]
Test open_basedir configuration [tests/security/open_basedir_file_get_contents.phpt]
Test open_basedir configuration [tests/security/open_basedir_file_put_contents.phpt]
Test open_basedir configuration [tests/security/open_basedir_fileatime.phpt]
Test open_basedir configuration [tests/security/open_basedir_filectime.phpt]
Test open_basedir configuration [tests/security/open_basedir_filegroup.phpt]
Test open_basedir configuration [tests/security/open_basedir_fileinode.phpt]
Test open_basedir configuration [tests/security/open_basedir_filemtime.phpt]
Test open_basedir configuration [tests/security/open_basedir_fileowner.phpt]
Test open_basedir configuration [tests/security/open_basedir_fileperms.phpt]
Test open_basedir configuration [tests/security/open_basedir_filesize.phpt]
Test open_basedir configuration [tests/security/open_basedir_filetype.phpt]
Test open_basedir configuration [tests/security/open_basedir_fopen.phpt]
Test open_basedir configuration [tests/security/open_basedir_glob.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_dir.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_executable.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_file.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_link.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_readable.phpt]
Test open_basedir configuration [tests/security/open_basedir_is_writable.phpt]
Test open_basedir configuration [tests/security/open_basedir_link.phpt]
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt]
Test open_basedir configuration [tests/security/open_basedir_lstat.phpt]
Test open_basedir configuration [tests/security/open_basedir_opendir.phpt]
Test open_basedir configuration [tests/security/open_basedir_readlink.phpt]
Test open_basedir configuration [tests/security/open_basedir_rename.phpt]
Test open_basedir configuration [tests/security/open_basedir_rmdir.phpt]
Test open_basedir configuration [tests/security/open_basedir_scandir.phpt]
Test open_basedir configuration [tests/security/open_basedir_stat.phpt]
Test open_basedir configuration [tests/security/open_basedir_symlink.phpt]
Test open_basedir configuration [tests/security/open_basedir_tempnam.phpt]
Test open_basedir configuration [tests/security/open_basedir_touch.phpt]
Test open_basedir configuration [tests/security/open_basedir_unlink.phpt]



================================================================================
/home/xuefer/src/php5/tests/basic/bug20539.phpt
================================================================================
Warning: Unknown: open(./tests/basic//sess_e1122b5c18b3b0ef0b69cbc36c5d0d0f, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Cannot send session cookie - headers already sent in Unknown on line 0

Warning: Unknown: Cannot send session cache limiter - headers already sent in Unknown on line 0
good :)

Warning: unlink(/home/xuefer/src/php5/tests/basic/sess_e1122b5c18b3b0ef0b69cbc36c5d0d0f): No such file or directory in /home/xuefer/src/php5/tests/basic/bug20539.php on line 3

Warning: Unknown: open(./tests/basic//sess_e1122b5c18b3b0ef0b69cbc36c5d0d0f, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (./tests/basic/) in Unknown on line 0




================================================================================
/home/xuefer/src/php5/tests/security/open_basedir_chdir.phpt
================================================================================
Warning: require_once(): open_basedir restriction in effect. File(/home/xuefer/src/php5/tests/security/open_basedir.inc) is not within the allowed path(s): (.) in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2

Warning: require_once(/home/xuefer/src/php5/tests/security/open_basedir.inc): failed to open stream: Operation not permitted in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2

Fatal error: require_once(): Failed opening required 'open_basedir.inc' (include_path='.:/usr/local/lib/php') in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2
================================================================================
001+ Warning: require_once(): open_basedir restriction in effect. File(/home/xuefer/src/php5/tests/security/open_basedir.inc) is not within the allowed path(s): (.) in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2^M
002+ ^M
003+ Warning: require_once(/home/xuefer/src/php5/tests/security/open_basedir.inc): failed to open stream: Operation not permitted in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2^M
001- *** Testing open_basedir configuration [chdir] ***^M
002- bool(true)^M
003- bool(true)^M
004- bool(true)^M
005- bool(true)^M
006- bool(true)^M
005+ Fatal error: require_once(): Failed opening required 'open_basedir.inc' (include_path='.:/usr/local/lib/php') in /home/xuefer/src/php5/tests/security/open_basedir_chdir.php on line 2^M
008- Warning: chdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d^M
009- bool(false)^M
010- ^M
011- Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d^M
012- bool(false)^M
013- ^M
014- Warning: chdir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d^M
015- bool(false)^M
016- ^M
017- Warning: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d^M
018- bool(false)^M
019- ^M
020- Warning: chdir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d^M
021- bool(false)^M
022- ^M
023- Warning: chdir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d^M
024- bool(false)^M
025- *** Finished testing open_basedir configuration [chdir] ***
================================================================================


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-17 09:28 UTC] lbarnaud@php.net
Reproducible on ZTS builds
 [2008-08-17 13:15 UTC] xuefer at gmail dot com
forgot to note that, when it is build outside of source tree, there're more test cases failed than i listed
 [2008-09-12 14:15 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC