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 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.
(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

Add a Patch

Pull Requests

Add a Pull Request

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: Wed Apr 24 04:01:30 2024 UTC