#40867 [Bgs]: open_basedir does not allow access to "/tmp" if "/tmp/" is in open_basedir list
ID: 40867
User updated by: phpbugs at thequod dot de
Reported By: phpbugs at thequod dot de
Status: Bogus
Bug Type: Safe Mode/open_basedir
Operating System: Ubuntu Linux
PHP Version: 5CVS-2007-03-20 (CVS)
New Comment:
..and directory "/tmp/" is in "/tmp"?
Previous Comments:
------------------------------------------------------------------------
[2007-03-20 17:31:44] tony2001@php.net
Yeah, directory /tmp is in /, not in /tmp/.
------------------------------------------------------------------------
[2007-03-20 17:18:43] phpbugs at thequod dot de
Description:
------------
If open_basedir is set to "/tmp/" and you do
<?php
is_dir( '/tmp' );
?>
you get a warning:
Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is
not within the allowed path(s): (/tmp/) in ..
Bug 39123 "Default for "upload_tmp_dir" changed to "/tmp"
(regression)" (http://bugs.php.net/39123) is related. Maybe the
regression's root is here?
Has this behaviour changed in PHP5 (e.g. 5.1.x)?
btw: the reason for not having "/tmp" in the open_basedir setting is
that it would allow access to all directories beginning with "tmp"
in the root filesystem.
Reproduce code:
---------------
$ php -d open_basedir=/tmp/ -d error_reporting=E_ALL \
-d display_errors=1 -r 'echo is_dir( "/tmp" ) ? 1 : 0;'
Expected result:
----------------
1
Actual result:
--------------
Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is
not within the allowed path(s): (/tmp/) in Command line code on line
1
0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40867&edit=1
Thread (3 messages)