From: kraghuba at in dot ibm dot com Operating system: MACOSX PHP version: 5CVS-2007-07-18 (snap) PHP Bug Type: Filesystem function related Bug description: realpath doesn't resolve symbolic link
Description: ------------ realpath() doesn't resolve symlink and returns the link file name when input path is a link path. As per the documentation at http://in.php.net/manual/en/function.realpath.php, The resulting path will have no symbolic link, '/./' or '/../' components. Applicable to php5.2.4 only on MacOS X. Please check testcase symlink_link_linkinfo_is_link_variation6.phpt. Reproduce code: --------------- <?php $file_path = dirname(__FILE__); $filename = "$file_path/file.tmp"; $linkname = "$file_path/link.tmp"; $fp = fopen($filename, "w"); fclose($fp); symlink($filename, $linkname); var_dump( realpath($linkname) ); unlink($linkname); unlink($filename); ?> Expected result: ---------------- string(%d) "%s/file.tmp" Actual result: -------------- string(%d) "%s/link.tmp" -- Edit bug report at http://bugs.php.net/?id=42038&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42038&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42038&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42038&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42038&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42038&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42038&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42038&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42038&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42038&r=support Expected behavior: http://bugs.php.net/fix.php?id=42038&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42038&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42038&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42038&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42038&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42038&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42038&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42038&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42038&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42038&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42038&r=mysqlcfg