ID:               42670
 Updated by:       [EMAIL PROTECTED]
 Reported By:      suicas at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Directory function related
 Operating System: Solaris 10
 PHP Version:      5.2.4
 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-09-14 12:47:50] suicas at gmail dot com

Description:
------------
Trying to include or require a file containing '../' in its path fails
with permission denied or file not found.

I've made sure that suhosin has not been loaded, and that safe mode is
turned off while testing this, and can provide PHP's configure line and
php.ini changes if needed.

This may to be related to closed bug #39351
(http://bugs.php.net/bug.php?id=39351).



Reproduce code:
---------------
File /www/included.php:
<?php echo 'Included ' ?>


File /www/a/index.php:
<?php
echo substr(sprintf('%o ', fileperms('/www/included.php')), -5);
include('/www/included.php');

echo substr(sprintf('%o ', fileperms('../included.php')), -5);
include('../included.php');
?>

Expected result:
----------------
When viewing file /www/a/index.php from a web browser:
0644 Included 0644 Included

When running PHP from the command line on /www/a/index.php:
0644 Included 0644 Included

Actual result:
--------------
>From a web browser:
0644 Included 0644
Warning: include(../included.php) [function.include]: failed to open
stream: Permission denied in /www/a/index.php on line 6

Warning: include() [function.include]: Failed opening '../included.php'
for inclusion (include_path='.:/opt/php5/lib/php') in /www/a/index.php
on line 6


>From the command line:
0644 Included

Warning: fileperms(): stat failed for ../included.php in
/www/a/index.php on line 5

Warning: include(../included.php): failed to open stream: No such file
or directory in /www/a/index.php on line 6

Warning: include(): Failed opening '../included.php' for inclusion
(include_path='.:/opt/php5/lib/php') in /www/a/index.php on line 6


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


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

Reply via email to