From: steve at nexusuk dot org Operating system: Linux (Fedora Core 4) PHP version: 5.0.4 PHP Bug Type: Filesystem function related Bug description: stat cache can cause problems after changing directory
Description: ------------ If you use relative path names and change the working directory then the cached data may point at the wrong file. Reproduce code: --------------- $a = file_exists('foo.txt'); chdir('bar'); $b = file_exists('foo.txt'); Expected result: ---------------- The second file_exists() call should check the file exists since it is not the same file as the original call. The stat cache should probably reference files by their absolute path names, or chdir() should clear the stat cache to ensure this doesn't happen. Actual result: -------------- If 'foo.txt' existed when checked the first time then the second file_exists() call will also return true, even if 'bar/foo.txt' doesn't exist. -- Edit bug report at http://bugs.php.net/?id=33610&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33610&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33610&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33610&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33610&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33610&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33610&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33610&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33610&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33610&r=support Expected behavior: http://bugs.php.net/fix.php?id=33610&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33610&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33610&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33610&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33610&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33610&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33610&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33610&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33610&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33610&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33610&r=mysqlcfg