#41899 [Csd->Asn]: Can't open files with leading relative path of '..' and '..' is not readable
| From: | tony2001@php.net | Date: | Fri, 06 Jul 2007 09:26:44 +0000 |
| Subject: | #41899 [Csd->Asn]: 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-114709@lists.php.net to get a copy of this message | ||
ID: 41899
Updated by: tony2001@php.net
Reported By: geoffwa at cs dot rmit dot edu dot au
-Status: Closed
+Status: Assigned
Bug Type: Streams related
Operating System: Solaris 10
PHP Version: 5.2.3
-Assigned To:
+Assigned To: tony2001
New Comment:
I'm still able to reproduce it, though I'm not able to debug it since
both GDB and GCC fail to compile on Solaris.
I'm working on that atm..
Previous Comments:
------------------------------------------------------------------------
[2007-07-06 07:54:46] sniper@php.net
Since it's fixed in CVS -> closed.
------------------------------------------------------------------------
[2007-07-06 01:03:53] geoffwa at cs dot rmit dot edu dot au
Is also broken in 5.2.0 and 5.2.2.
Appears to be fixed in latest snapshot:
> ./php-5.2-200707060030 -v
PHP 5.2.4-dev (cli) (built: Jul 6 2007 10:59:53)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
> ./php-5.2-200707060030 -f test.php
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
------------------------------------------------------------------------
[2007-07-05 21:59:45] sniper@php.net
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
------------------------------------------------------------------------
[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