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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
3 + 5 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC