#40867 [Opn->Bgs]: open_basedir does not allow access to "/tmp" if "/tmp/" is in open_basedir list

From: Date: Tue, 20 Mar 2007 17:31:44 +0000
Subject: #40867 [Opn->Bgs]: open_basedir does not allow access to "/tmp" if "/tmp/" is in open_basedir list
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110586@lists.php.net to get a copy of this message
 ID:               40867
 Updated by:       tony2001@php.net
 Reported By:      phpbugs at thequod dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Safe Mode/open_basedir
 Operating System: Ubuntu Linux
 PHP Version:      5CVS-2007-03-20 (CVS)
 New Comment:

Yeah, directory /tmp is in /, not in /tmp/.


Previous Comments:
------------------------------------------------------------------------

[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)

« previous php.bugs (#110586) next »