|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-16 17:55 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 06:00:01 2025 UTC |
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)