|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #101 fileperms & fileinode bombs on symlinked files
Submitted: 1998-02-24 20:11 UTC Modified: 1998-02-25 03:04 UTC
From: walshj at ns dot net Assigned:
Status: Closed Package: Other
PHP Version: 3.0b4 OS: Solaris 2.51
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: walshj at ns dot net
New email:
PHP Version: OS:


 [1998-02-24 20:11 UTC] walshj at ns dot net
I know that 3.0b5 and the CVS has the file_exists() function, but for previous version, I noticed that the fileperms()/fileinode() family of functions do not work correctly with symbolic links.   Say for example that "/etc/test/passwd" is a symbolic link to "/etc/passwd" (see below code).

$test = "/etc/test/passwd";
$file_exists = fileperms($test);
echo "test=", $file_exists;

All that is outputted is


instead of the correct value or -1 if there's an error (the -1 stuff might have changed, but it's not documented in the PHP3 manuals).  If the file is not a symbolic link or doesn't have a symbolic link in its path, it works fine.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-25 03:04 UTC] jim
When the file does not exist, the various stat-like functions
return false, which doesn't echo anything when printed. Also, in
3.0b5 and later, you can use the file_exists() function instead
of "faking it" with one of the other file functions. This
makes your code much more readable.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 22:01:28 2024 UTC