ID: 31127 Updated by: [EMAIL PROTECTED] 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