#31553 [Fbk->Csd]: include does not follow symlinks starting with ..
| From: | pterjan at linuxfr dot org | Date: | Fri, 14 Jan 2005 17:21:58 +0000 |
| Subject: | #31553 [Fbk->Csd]: include does not follow symlinks starting with .. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72164@lists.php.net to get a copy of this message | ||
ID: 31553
User updated by: pterjan at linuxfr dot org
Reported By: pterjan at linuxfr dot org
-Status: Feedback
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Mandrakelinux
PHP Version: 4.3.10
New Comment:
Works fine with the php4-STABLE-200501141530 I just built.
I noticed the Mandrakelinux rpm is built with Hardened-PHP v0.2.4 and
0.2.5 annouces "- fixes the new realpath() implementation with some
symlinks" so I guess this was the problem.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2005-01-14 17:33:34] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Or it's something wrong with your system. Works fine for me.
------------------------------------------------------------------------
[2005-01-14 15:00:40] pterjan at linuxfr dot org
Just tested with PHP 5.0.2, the problem does not occur.
------------------------------------------------------------------------
[2005-01-14 14:55:35] pterjan at linuxfr dot org
Description:
------------
include does not follow symlinks starting with ..
Reproduce code:
---------------
[pterjan@dhcp122 php-test]$ pwd
/tmp/php-test
[pterjan@dhcp122 php-test]$ ll
total 4
drwxr-xr-x 2 pterjan pterjan 4096 jan 14 14:31 a/
lrwxrwxrwx 1 pterjan pterjan 1 jan 14 14:31 b -> a/
lrwxrwxrwx 1 pterjan pterjan 15 jan 14 14:31 c -> /tmp/php-test/a/
lrwxrwxrwx 1 pterjan pterjan 13 jan 14 14:31 d -> ../php-test/a/
lrwxrwxrwx 1 pterjan pterjan 3 jan 14 14:35 e -> ./a/
lrwxrwxrwx 1 pterjan pterjan 6 jan 14 14:48 f -> a/../a/
[pterjan@dhcp122 php-test]$ ll */foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 a/foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 b/foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 c/foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 d/foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 e/foo.php
-rw-r--r-- 1 pterjan pterjan 0 jan 14 14:31 f/foo.php
[pterjan@dhcp122 php-test]$ php -r 'include("a/foo.php");'
[pterjan@dhcp122 php-test]$ php -r 'include("b/foo.php");'
[pterjan@dhcp122 php-test]$ php -r 'include("c/foo.php");'
[pterjan@dhcp122 php-test]$ php -r 'include("d/foo.php");'
Warning: Unknown(d/foo.php): failed to open stream: No such file or
directory in Command line code on line 1
Warning: (null)(): Failed opening 'd/foo.php' for inclusion
(include_path='.:/usr/lib/php/:/usr/share/pear/') in Command line code
on line 1
[pterjan@dhcp122 php-test]$ php -r 'include("e/foo.php");'
[pterjan@dhcp122 php-test]$ php -r 'include("f/foo.php");'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31553&edit=1