php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41847 open_basedir warning if a symlink does not exist
Submitted: 2007-06-29 00:09 UTC Modified: 2007-07-07 01:00 UTC
From: phpbugs at thequod dot de Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5CVS-2007-06-29 (CVS) OS: Ubuntu 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: phpbugs at thequod dot de
New email:
PHP Version: OS:

 

 [2007-06-29 00:09 UTC] phpbugs at thequod dot de
Description:
------------
You'll get a open_basedir related warning, if you try to access a 
symlink in open_basedir, but which points to a non-existent file:

PHP Warning:  file_exists(): open_basedir restriction in effect. 
File(symlink-exists-not) is not within the allowed path(s): 
(/tmp/open_basedir-symlinks)



Reproduce code:
---------------
$ ls -l
.
..
open_basedir-warning-if-symlink-does-not-exist.php
symlink-exists -> .
symlink-exists-not -> foo

$ php -d open_basedir=`pwd` open_basedir-warning-if-symlink-does-not-exist.php

open_basedir-warning-if-symlink-does-not-exist.php:
---------------------------------------------------
<?php
var_dump( file_exists('symlink-exists') );
var_dump( file_exists('symlink-exists-not') );

var_dump( file_exists($_SERVER['argv'][0]) );
var_dump( file_exists('does-not-exist') );
?>
---------------------------------------------------


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


Actual result:
--------------
bool(true)
PHP Warning:  file_exists(): open_basedir restriction in effect. 
File(symlink-exists-not) is not within the allowed path(s): 
(/tmp/open_basedir-symlinks) 
in /tmp/open_basedir-symlinks/open_basedir-warning-if-symlink-does-not-exist.php 
on line 3
bool(false)
bool(true)
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 03:01:26 2018 UTC