php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9563 realpath() returns empty string when working directory is under a symbolic link
Submitted: 2001-03-05 11:11 UTC Modified: 2001-06-03 04:14 UTC
From: agreenbu at intelenet dot state dot in dot us Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: Solaris 2.7
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: agreenbu at intelenet dot state dot in dot us
New email:
PHP Version: OS:

 

 [2001-03-05 11:11 UTC] agreenbu at intelenet dot state dot in dot us
/opt/apache/htdocs is the Document Root for Apache.
/opt/apache/htdocs/directory is a symbolic link that points to /home/morespace/directory. Document /home/morespace/directory/username/index.php contains the code:

$RealPath = realpath(".");

if (!stristr($RealPath, $UserName)){
        echo "This directory does not belong to you.  Attempt has been logged.";
        session_destroy();
        exit;
}

This code always fails because realpath(".") returns an empty string.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-05 12:29 UTC] agreenbu at intelenet dot state dot in dot us
Looks like it rejects symbolic links under Solaris 2.7 altogether...
 [2001-06-03 04:14 UTC] sniper@php.net
This should be fixed with PHP 4.0.6, please try the 
latest release candidate:

http://www.php.net/~andi/php-4.0.6RC2.tar.gz

-Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC