php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42540 open_basedir=/ makes disk_total_space("/") return false
Submitted: 2007-09-04 08:50 UTC Modified: 2007-09-04 10:11 UTC
From: Sjon at react dot nl Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.2.4 OS: linux 2.6.22.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Sjon at react dot nl
New email:
PHP Version: OS:

 

 [2007-09-04 08:50 UTC] Sjon at react dot nl
Description:
------------
when open_basedir is set to / disk_total_space('/') returns false; even though the documentation states:
  if set, limits all file operations to the defined directory and below

Shouldn't 'open_basedir=/' behave like 'open_basedir=' ?

Reproduce code:
---------------
[sjon@spider010 ~]$ php -r 'var_dump(disk_total_space("/"));' -d open_basedir=
float(99999830016)

[sjon@spider010 ~]$ php -r 'var_dump(disk_total_space("/"));' -d open_basedir=/
bool(false)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-04 09:46 UTC] jani@php.net
Are you really using PHP 5.2.4? I get this:

# php -n -dopen_basedir="/" -r 'var_dump(disk_total_space("/"));' 
float(76318621696)

 [2007-09-04 10:02 UTC] Sjon at react dot nl
Yes, definitely. Might this be related to Suhosin-Patch, that the package-creator decided to include?

[sjon@sjon ~]$ php -v
PHP 5.2.4 with Suhosin-Patch 0.9.6.2 (cli) (built: Sep  2 2007 12:29:31) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
[sjon@sjon ~]$ php -r 'var_dump(disk_total_space("/"));' -dopen_basedir=/
bool(false)
[sjon@sjon ~]$ php -r 'var_dump(disk_total_space("/"));' -dopen_basedir= 
float(99996684288)
 [2007-09-04 10:11 UTC] johannes@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

Please test with a snapshot, without suhosin and other patches. Neither Jani nor me can reproduce it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 05 17:01:31 2024 UTC