From: elapouya at gmail dot com
Operating system: Ubuntu 8.10
PHP version: 5.3.0RC1
PHP Bug Type: Safe Mode/open_basedir
Bug description: ini_set("open_basedir") does not work on multiple reload
(mod_php)
Description:
------------
If you put an
ini_set("open_basedir","/var/www/mydir");
in your code,
the first time it will work, put if you reload the page quickly, you will
get a "open_basedir restriction in effect" on a jammed directory !
If I wait 1 minute, it works again for the first time and no more the next
times : looks like a cache problem.
I do not have APC, xdebug etc...
Nothing in php.ini except the error_reporting turned to On.
the configure :
'./configure' '--with-apxs2=/usr/bin/apxs2' '--disable-short-tags'
'--with-openssl' '--with-zlib' '--enable-bcmath' '--with-bz2=/bin/bzip2'
'--enable-calendar' '--with-curl' '--with-curlwrappers' '--enable-exif'
'--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/lib'
'--with-png-dir=/usr/lib' '--with-xpm-dir=/usr/lib' '--with-ttf'
'--with-t1lib' '--enable-gd-native-ttf' '--enable-gd-jis-conv'
'--with-gettext' '--with-imap' '--with-imap-ssl' '--with-ldap'
'--with-ldap-sasl' '--enable-mbstring' '--with-mcrypt' '--with-mhash'
'--with-ming' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd'
'--with-ncurses' '--with-pdo-mysql' '--with-pspell' '--with-readline'
'--with-snmp' '--enable-soap' '--enable-sockets' '--without-sqlite'
'--enable-sqlite-utf8' '--with-tidy' '--enable-wddx' '--with-xmlrpc'
'--with-xsl' '--enable-zip' '--with-pear' '--with-kerberos'
Note : I use PHP as a Apache module
Reproduce code:
---------------
In /var/www/elapouya, I create the file open_basedir.php :
<?php
ini_set("open_basedir","/var/www/elapouya");
?>
Expected result:
----------------
no error
Actual result:
--------------
First time : No error,
Next times :
Warning: Unknown: open_basedir restriction in effect.
File(/var/www/elapouya/open_basedir.php) is not within the allowed path(s):
(ä£Â¸/www/elapouya) in Unknown on line 0
Warning: Unknown: failed to open stream: Operation not permitted in
Unknown on line 0
Fatal error: Unknown: Failed opening required
'/var/www/elapouya/open_basedir.php' (include_path='.:/usr/local/lib/php')
in Unknown on line 0
--
Edit bug report at http://bugs.php.net/?id=47945&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47945&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47945&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47945&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47945&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47945&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47945&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47945&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47945&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47945&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47945&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47945&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47945&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47945&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47945&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47945&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47945&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47945&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47945&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47945&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47945&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47945&r=mysqlcfg