#40867 [NEW]: open_basedir does not allow access to "/tmp" if "/tmp/" is in open_basedir list
From: phpbugs at thequod dot de
Operating system: Ubuntu Linux
PHP version: 5CVS-2007-03-20 (CVS)
PHP Bug Type: Safe Mode/open_basedir
Bug description: open_basedir does not allow access to "/tmp" if "/tmp/" is in
open_basedir list
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 bug report at http://bugs.php.net/?id=40867&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40867&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40867&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40867&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40867&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40867&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40867&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40867&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40867&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40867&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40867&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40867&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40867&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40867&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40867&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40867&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40867&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40867&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40867&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40867&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40867&r=mysqlcfg
Thread (3 messages)
- phpbugs at thequod dot de