#42038 [Opn]: realpath doesn't resolve symbolic link
| From: | kraghuba at in dot ibm dot com | Date: | Thu, 19 Jul 2007 03:21:45 +0000 |
| Subject: | #42038 [Opn]: realpath doesn't resolve symbolic link | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115214@lists.php.net to get a copy of this message | ||
ID: 42038
User updated by: kraghuba at in dot ibm dot com
Reported By: kraghuba at in dot ibm dot com
Status: Open
Bug Type: Filesystem function related
-Operating System: MacOSX
+Operating System: MacOSX, FreeBSD
PHP Version: 5CVS-2007-07-18 (snap)
New Comment:
The reference to testcase symlink_link_linkinfo_is_link_variation6.phpt
is wrong. The write testcases to check are :
ext/standard/tests/file/readlink_realpath_basic1.phpt
ext/standard/tests/file/readlink_realpath_variation1.phpt
ext/standard/tests/file/readlink_realpath_variation2.phpt
The similar failure is also noticed on FreeBSD.
(FreeBSD - FreeBSD lindsay.php.is 6.2-STABLE FreeBSD 6.2-STABLE #1: Thu
Jun 28 22:12:54 CEST 2007 )
MACOSX details:
Darwin - Darwin thought 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23
16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386
Previous Comments:
------------------------------------------------------------------------
[2007-07-18 17:16:51] kraghuba at in dot ibm dot com
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 this bug report at http://bugs.php.net/?id=42038&edit=1