ID:               42048
 User updated by:  quasi at di dot uoa dot gr
 Reported By:      quasi at di dot uoa dot gr
 Status:           Open
 Bug Type:         *Directory/Filesystem functions
 Operating System: Solaris 10
 PHP Version:      5.2.3
 New Comment:

Sorry, I forgot to stress that the user executing "php
/tmp/d1/d2/f.php" must be some other user and not the one that created
the files so that the 711 access rights have some actual impact...


Previous Comments:
------------------------------------------------------------------------

[2007-07-19 14:17:42] quasi at di dot uoa dot gr

Description:
------------
commands like require('../somefile') fail although they didn't in
versions prior to 5.2.0. This happens when the user running the command
does not have 'r' rights to the directory of the included file. Bug
#39351 seems related but it is supposedly closed.

Reproduce code:
---------------
cd tmp
umask 022
mkdir d1
chmod 711 d1
cd d1
echo Included > fin.php
mkdir d2
cd d2
echo '<? require("/tmp/d1/fin.php") ?>' > f.php
echo '<? require("../fin.php") ?>' >> f.php
php /tmp/d1/d2/f.php


Expected result:
----------------
Included
Included

Actual result:
--------------
Included

Warning: require(../fin.php): failed to open stream: Permission denied
in f.php on line 2

Fatal error: require(): Failed opening required '../fin.php'
(include_path='.:/opt/php/lib/php') in f.php on line 2



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42048&edit=1

Reply via email to