php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53687 Use of colon character in open_basedir paths
Submitted: 2011-01-07 17:51 UTC Modified: 2013-02-18 00:34 UTC
From: luckyluke at softhome dot net Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.3.5 OS: linux-2.6 x86_64
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-01-07 17:51 UTC] luckyluke at softhome dot net
Description:
------------
Documentation says that on *nix systems open_basedir paths must be separated by 
colon characters, but it does not say if it is possible and how to include a path 
containing an actual colon (which is a perfectly valid path on linux, for 
example).

How can I add /foo:bar to open_basedir?

Expected result:
----------------
I should be able to know if and how to escape the separator colon, for example 
with
open_basedir = /www\:80:/somewhere_else
to add the two directories '/www:80' and'/somewhere_else'.

Documentation should tell me I cannot use colons in paths, or tell me how I can 
use them.

(besides, if there isn't any escape possibility it should be added IMHO)

Actual result:
--------------
Adding a path with a colon inside gets interpreted as two different paths.
Official documentation does not help on the matter.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-25 20:25 UTC] philip@php.net
-Status: Open +Status: Feedback
 [2011-01-25 20:25 UTC] philip@php.net
Can you please test that escaping mechanism? Maybe you could also test it within 
PATH itself
 [2013-02-05 11:00 UTC] luckyluke at softhome dot net
I was just giving an example. Anyway I did actually try to escape colons with 
backslashes, and I re-tried now on PHP 5.3.15, without success.
 [2013-02-05 11:29 UTC] luckyluke at softhome dot net
Additionally, if you have colons in intermediate elements of a path, like this:
  /www/foo:80/bar
and you specify an open_basedir like "/www" or "/www/", PHP will block any access 
to the above path.

Unfortunately I cannot, at the moment, test this on recent versions of PHP and/or 
ones without Suhosin installed, but it does replicate perfectly on my PHP-
5.3.15+Suhosin-0.9.33 system.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC