#31127 [Opn->Bgs]: The "." in open_basedir is always getting translated to SG(path_translated) dir
| From: | derick@php.net | Date: | Thu, 16 Dec 2004 16:55:08 +0000 |
| Subject: | #31127 [Opn->Bgs]: The "." in open_basedir is always getting translated to SG(path_translated) dir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70380@lists.php.net to get a copy of this message | ||
ID: 31127
Updated by: derick@php.net
Reported By: kameshj at fastmail dot fm
-Status: Open
+Status: Bogus
Bug Type: CGI related
Operating System: Any Operating System
PHP Version: 5.0.3
New Comment:
No bug here, unless all other SAPI's the CLI will not chdir to the
scripts directory so the CWD is different now.
Previous Comments:
------------------------------------------------------------------------
[2004-12-16 16:59:27] kameshj at fastmail dot fm
Description:
------------
The "." in open_basedir is always getting translated to directory
portion of SG(path_translated).
This behaviour is fine for a CGI or mod_php5 module. But not for a CLI
where "." != the directory of the script
Reproduce code:
---------------
1)Keep a script in /home/kameshj/scripts/test.php
2)Keep a file k.txt with some content in /home/kameshj
3)Keep open_basedir as "."
///home/kameshj/scripts/test.php
<?php
echo getcwd();
echo "\n";
var_dump(file_exists("/home/kameshj/k.txt"));
?>
Run the above php from the working directory /home/kameshj
php /home/kameshj/scripts/test.php
Even though we have "."(/home/kameshj in this case) as open_basedir and
we access /home/kameshj/k.txt file_access will still fail as "." is
taken as /home/kameshj/scripts
Expected result:
----------------
/home/kameshj
bool(true)
Actual result:
--------------
/home/kameshj
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31127&edit=1