php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39953 chdir(..) not working in open_basedir where chdir(../) does !
Submitted: 2006-12-26 10:50 UTC Modified: 2007-01-03 01:00 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zend at oliwel dot de Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 5.2.0 OS: Linux
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 39 = ?
Subscribe to this entry?

 
 [2006-12-26 10:50 UTC] zend at oliwel dot de
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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-26 10:53 UTC] zend at oliwel dot de
is not working with OPEN_BASEDIR turned on - nothing to do with safe_mode....
 [2006-12-26 11:07 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-01-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC