#41899 [Opn->Fbk]: Can't open files with leading relative path of '..' and '..' is not readable
| From: | sniper@php.net | Date: | Thu, 05 Jul 2007 21:59:46 +0000 |
| Subject: | #41899 [Opn->Fbk]: Can't open files with leading relative path of '..' and '..' is not readable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114693@lists.php.net to get a copy of this message | ||
ID: 41899
Updated by: sniper@php.net
Reported By: geoffwa at cs dot rmit dot edu dot au
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: Solaris 10
PHP Version: 5.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2007-07-05 06:34:06] geoffwa at cs dot rmit dot edu dot au
Description:
------------
(possibly related to bug #39953 or bug #39351)
If a relative path to a file has '..' as a leading path component,
and the directory referred to by '..' is not readable by the user,
then opening a file using the relative path fails.
Using an absolute path or a path with a non-'..' leading component
opens said file just fine.
Reproduce code:
---------------
See http://goanna.cs.rmit.edu.au/~geoffwa/relative_path_bug.php
for a large test script.
Expected result:
----------------
(Using PHP 5.1.4)
Current working directory is: /home/g/geoffwa/test
Opened /home/g/geoffwa/test/a/b/file
Opened ./a/b/file from ./a using ./b/file
Opened ./a/b/file from ./a using ./b/c/../file
Opened ./a/b/file from ./a/b/c using ../file
Opened ../file from ./a/b/c using ./../file
Opened ./a/b/file from ./a/b using ./file
Opened ./a/file from ./a/b using ./c/../../file
Opened ./a/b/c/file from ./a/b/c using ../c/file
Actual result:
--------------
(Using PHP 5.2.3 + suhosin patch)
Opened /home/g/geoffwa/test/a/b/file
Opened ./a/b/file from ./a using ./b/file
Opened ./a/b/file from ./a using ./b/c/../file
Failed to open ./a/b/file from ./a/b/c using ../file
Failed to open ./a/b/file from ./a/b/c using ./../file
Opened ./a/b/file from ./a/b using ./file
Opened ./a/file from ./a/b using ./c/../../file
Failed to open ./a/b/c/file from ./a/b/c using ../c/file
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41899&edit=1