#39953 [NEW]: chdir(..) not working in open_basedir where chdir(../) does !

From: Date: Tue, 26 Dec 2006 10:50:41 +0000
Subject: #39953 [NEW]: chdir(..) not working in open_basedir where chdir(../) does !
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106889@lists.php.net to get a copy of this message
From: zend at oliwel dot de Operating system: Linux PHP version: 5.2.0 PHP Bug Type: Directory function related Bug description: chdir(..) not working in open_basedir where chdir(../) does ! Description: ------------ Set open_basedir to /myscript Try to do 'chdir("..")' from a file in /myscript/dir/ results in an open_basedir exception. Using chdir("../") instead works. PHPMyAdmin uses chdir("..") in the css/ directory, is not working with safemode turned on. Reproduce code: --------------- <? // create directory bugme before executing the script error_reporting(E_ALL); chdir("bugme"); echo getcwd(); chdir(".."); echo getcwd(); chdir("../"); ?> Expected result: ---------------- Directory Change to upper directory on first call Actual result: -------------- Warning: chdir() [function.chdir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): (/webtree/htdocs/sql/) in /webtree/htdocs/sql/test.php -- Edit bug report at http://bugs.php.net/?id=39953&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39953&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39953&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39953&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39953&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39953&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39953&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39953&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39953&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39953&r=support Expected behavior: http://bugs.php.net/fix.php?id=39953&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39953&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39953&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39953&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39953&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39953&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39953&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39953&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39953&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39953&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39953&r=mysqlcfg

« previous php.bugs (#106889) next »