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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zend at oliwel dot de
New email:
PHP Version: OS:

 

 [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