#41847 [NEW]: open_basedir warning if a symlink does not exist
| From: | phpbugs at thequod dot de | Date: | Fri, 29 Jun 2007 00:09:09 +0000 |
| Subject: | #41847 [NEW]: open_basedir warning if a symlink does not exist | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114426@lists.php.net to get a copy of this message | ||
From: phpbugs at thequod dot de
Operating system: Ubuntu Linux
PHP version: 5CVS-2007-06-29 (CVS)
PHP Bug Type: *General Issues
Bug description: open_basedir warning if a symlink does not exist
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)
--
Edit bug report at http://bugs.php.net/?id=41847&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41847&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41847&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41847&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41847&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41847&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41847&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41847&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41847&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41847&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41847&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41847&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41847&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41847&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41847&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41847&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41847&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41847&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41847&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41847&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41847&r=mysqlcfg