php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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

test=

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.

Patches

Pull Requests

History

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: Sat Dec 07 06:01:28 2024 UTC