php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40867 open_basedir does not allow access to "/tmp" if "/tmp/" is in open_basedir list
Submitted: 2007-03-20 17:18 UTC Modified: 2007-03-25 13:57 UTC
From: phpbugs at thequod dot de Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 5CVS-2007-03-20 (CVS) OS: Ubuntu Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugs at thequod dot de
New email:
PHP Version: OS:

 

 [2007-03-20 17:18 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-20 17:31 UTC] tony2001@php.net
Yeah, directory /tmp is in /, not in /tmp/.
 [2007-03-25 13:57 UTC] phpbugs at thequod dot de
..and directory "/tmp/" is in "/tmp"?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 23:01:25 2025 UTC