ID: 36297
Updated by: [EMAIL PROTECTED]
Reported By: smartgenius1 at yahoo dot com
-Status: Bogus
+Status: Feedback
Bug Type: Safe Mode/open_basedir
Operating System: Windows
PHP Version: 5.1.2
New Comment:
And what if you try to set it to the real path instead of "."?
I doubt that PHP is able to distinguish "." when you're in /path/1 from
"." when you're in "/another/path".
Previous Comments:
------------------------------------------------------------------------
[2006-02-05 20:27:52] [EMAIL PROTECTED]
Well.... "." is the current working directory, so ofcourse you can read
it then...
------------------------------------------------------------------------
[2006-02-05 20:25:39] smartgenius1 at yahoo dot com
I have it set to "."
------------------------------------------------------------------------
[2006-02-05 20:24:48] [EMAIL PROTECTED]
What is the value of open_basedir?
------------------------------------------------------------------------
[2006-02-05 19:13:21] smartgenius1 at yahoo dot com
I was also able to unlink() files; and also fwrite() things as well. I
had full permissions; as if I was working in ./ and no error ever
occured.
------------------------------------------------------------------------
[2006-02-05 18:42:07] smartgenius1 at yahoo dot com
Description:
------------
The function chdir() does NOT obey the open_basedir restriction on
windows. Chdir() ONLY checks the UID of the directories; and on Windows
there are no UIDs. So it is possible to do
chdir("../");
and it works on windows; even if the open_basedir restriction is set to
"."; which should be blocking it.
And to make sure I had open_basedir restriction configured correctly; I
tried this:
opendir("../");
and sure enough; an error stating that the restriction was on.
Reproduce code:
---------------
<?
chdir("../");
?>
Expected result:
----------------
A PHP error stating that the open_basedir restriction was on
Actual result:
--------------
It worked. No errors at all; and I was able to open the directory with
opendir(getcwd());
after changing the current working directory to the above directory.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36297&edit=1