#32627 [Csd]: realpath fails to return FALSE if last path component does not exist

From: Date: Thu, 07 Apr 2005 19:42:40 +0000
Subject: #32627 [Csd]: realpath fails to return FALSE if last path component does not exist
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-76499@lists.php.net to get a copy of this message
ID: 32627 User updated by: alan dot harder at sun dot com Reported By: alan dot harder at sun dot com Status: Closed Bug Type: Filesystem function related Operating System: FreeBSD 4.11-STABLE PHP Version: 4.3.10 New Comment: thanks for the response. by "latest" do you mean php5? as shown in this bug description I tested with today's stable 4.3.x build in addition to 4.3.10 where i found the problem. Previous Comments: ------------------------------------------------------------------------ [2005-04-07 21:04:46] sniper@php.net Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php ------------------------------------------------------------------------ [2005-04-07 18:23:45] alan dot harder at sun dot com Description: ------------ I have found that realpath() returns a path when it should return FALSE if only the last path component in the given string does not exist. Tested on php 4.3.10 and php4-STABLE-200504071438. Both tests and phpinfo can be viewed at http://realpath.moshpit.org/ Reproduce code: --------------- $x = realpath('/bad/path'); var_dump($x); $x = realpath('/badpath'); var_dump($x); $x = realpath('/tmp/badpath'); var_dump($x); View tests at http://realpath.moshpit.org/ Expected result: ---------------- FALSE for all three tests. Actual result: -------------- The first one works (gets FALSE), the other two return the path when they should return FALSE (assuming /tmp is valid). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32627&edit=1

« previous php.bugs (#76499) next »