From: framelio at gmail dot com
Operating system: Linux
PHP version: 5.3.1
PHP Bug Type: Safe Mode/open_basedir
Bug description: file_exists gives warning with path with file as dir and
open_basedir
Description:
------------
I have PHP 5.3.1 installed ad apache module with apache version
Apache/2.2.14.
I configured a virtual host with the directive:
php_admin_value open_basedir "/usr/share/pear:/home:/var/www/hosts:/tmp"
The script is into the path: /home/user/web/test.php
and there is a symbolik link from "/var/www/hosts/domain.tld" to
"/home/user/web"
When I try to execute a file_exists on a path like this:
/var/www/hosts/domain.tld/test.php/testfile.file
Where "test.php" is a FILE and not a DIRECTORY
On all the other cases, no errors.
The special condition is the symbolink link and the filename in the path
(like it's a directory).
Reproduce code:
---------------
var_dump(file_exists("/var/www/hosts/domain.tld/test.php/testfile.file"));
// Where "test.php" is a FILE and not a DIRECTORY, and domain.tld is a
symbolink link to another directory.
Expected result:
----------------
bool(false)
Actual result:
--------------
Warning: file_exists() [function.file-exists]: open_basedir restriction
in effect. File(/var/www/hosts/domain.tld/test.php/testfile.file) is not
within the allowed path(s): (/usr/share/pear:/home:/var/www/hosts:/tmp) in
/home/user/web/test.php on line 1
--
Edit bug report at http://bugs.php.net/?id=50709&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50709&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50709&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50709&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50709&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50709&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50709&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50709&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50709&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50709&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50709&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50709&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50709&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50709&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50709&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50709&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50709&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50709&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50709&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50709&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50709&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50709&r=mysqlcfg