From: jake at yahoo-inc dot com Operating system: redhat e linux (2.6.9-42.ELsmp) PHP version: 5.2.6 PHP Bug Type: *Directory/Filesystem functions Bug description: open_basedir as prefix complains on attempts to access non-existant files
Description: ------------ When using open_basedir as a prefix, attempting to access files or directories which match the prefix but are not present on the filesystem raise open_basedir restriction warnings. Reproduce code: --------------- // create files or directories on the file system "/foo1", "/foo2" // add "/foo" (not "/foo/") to the open basedir restriction, then: var_dump(file_exists('/foo1')); var_dump(file_exists('/foo2')); var_dump(file_exists('/foo3')); Expected result: ---------------- this is the output returned: bool(true) bool(true) bool(false) which is expected, however, the "false" returned by the third call is disingenuous... it is false because the call is being blocked by open_basedir, and the following warning is triggered: [Fri May 2 17:33:05 2008] [error] PHP Warning: file_exists(): open_basedir restriction in effect. File(/foo3) is not within the allowed path(s) -- Edit bug report at http://bugs.php.net/?id=44901&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44901&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44901&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44901&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44901&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44901&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44901&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44901&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44901&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44901&r=support Expected behavior: http://bugs.php.net/fix.php?id=44901&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44901&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44901&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44901&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44901&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44901&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44901&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44901&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44901&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44901&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44901&r=mysqlcfg