php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50709 file_exists() triggers a warning when path contains file as dir and open_basedir
Submitted: 2010-01-09 18:03 UTC Modified: 2013-02-18 00:34 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: framelio at gmail dot com Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.3.1 OS: Linux
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: framelio at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-09 18:03 UTC] framelio at gmail dot com
Description:
------------
I have PHP 5.3.1 installed ad apache module with apache version Apache/2.2.14.

I configured a virtual host with the directive:
php_admin_value open_basedir "/usr/share/pear:/home:/var/www/hosts:/tmp"

The script is into the path: /home/user/web/test.php
and there is a symbolik link from "/var/www/hosts/domain.tld" to "/home/user/web"

When I try to execute a file_exists on a path like this:

/var/www/hosts/domain.tld/test.php/testfile.file

Where "test.php" is a FILE and not a DIRECTORY

On all the other cases, no errors.
The special condition is the symbolink link and the filename in the path (like it's a directory).


Reproduce code:
---------------
var_dump(file_exists("/var/www/hosts/domain.tld/test.php/testfile.file"));
// Where "test.php" is a FILE and not a DIRECTORY, and domain.tld is a symbolink link to another directory.

Expected result:
----------------
bool(false)

Actual result:
--------------
Warning:  file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/hosts/domain.tld/test.php/testfile.file) is not within the allowed path(s): (/usr/share/pear:/home:/var/www/hosts:/tmp) in /home/user/web/test.php on line 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-24 04:16 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2010-04-24 04:16 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC