FAQ
ID: 41899
Updated by: sniper@php.net
Reported By: geoffwa at cs dot rmit dot edu dot au
-Status: Open
+Status: Closed
Bug Type: Streams related
Operating System: Solaris 10
PHP Version: 5.2.3
New Comment:

Since it's fixed in CVS -> closed.


Previous Comments:
------------------------------------------------------------------------

[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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 28 | next ›
Discussion Overview
groupphp-bugs @
categoriesphp
postedJul 5, '07 at 6:34a
activeOct 10, '07 at 11:55p
posts28
users4
websitephp.net

People

Translate

site design / logo © 2018 Grokbase