#42048 [Opn->Bgs]: require fails to include relative path names

From: Date: Thu, 19 Jul 2007 15:18:57 +0000
Subject: #42048 [Opn->Bgs]: require fails to include relative path names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115240@lists.php.net to get a copy of this message
ID: 42048 Updated by: jani@php.net Reported By: quasi at di dot uoa dot gr -Status: Open +Status: Bogus Bug Type: *Directory/Filesystem functions Operating System: Solaris 10 PHP Version: 5.2.3 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. See bug #41822 Previous Comments: ------------------------------------------------------------------------ [2007-07-19 14:57:01] quasi at di dot uoa dot gr 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... ------------------------------------------------------------------------ [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

« previous php.bugs (#115240) next »