From:             kameshj at fastmail dot fm
Operating system: Any Operating System
PHP version:      5.0.3
PHP Bug Type:     CGI related
Bug description:  The "." in open_basedir is always getting translated to 
SG(path_translated) dir

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 bug report at http://bugs.php.net/?id=31127&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31127&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31127&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31127&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31127&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31127&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31127&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31127&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31127&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31127&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31127&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31127&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31127&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31127&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31127&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31127&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31127&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31127&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31127&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31127&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31127&r=mysqlcfg

Reply via email to