Bug #60636 [Com]: Dots in folders results in a open_basedir restriction warning

From: Date: Sun, 30 Dec 2012 09:28:21 +0000
Subject: Bug #60636 [Com]: Dots in folders results in a open_basedir restriction warning
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175659@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60636&edit=1

 ID:                 60636
 Comment by:         support at hostinghood dot com
 Reported by:        fernando at consultorpc dot com
 Summary:            Dots in folders results in a open_basedir
                     restriction warning
 Status:             Open
 Type:               Bug
 Package:            Safe Mode/open_basedir
 Operating System:   Linux
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

open_basedir works correctly, tested myself.


Previous Comments:
------------------------------------------------------------------------
[2012-01-04 04:34:21] laruence@php.net

hmm, I can't no reproduce this if you are sure that "/home/example" exists.

------------------------------------------------------------------------
[2012-01-03 17:13:40] fernando at consultorpc dot com

Yes, /home/example exists. If i rename myfolder.example to myfolderexample ( no 
dots ), them it works as expected. Meaning that it will return false without any 
warnings.

------------------------------------------------------------------------
[2012-01-03 17:06:24] laruence@php.net

does that /home/example exists? I think this might has nothing to do with the 
*dot*, but a mis-understand warning.

------------------------------------------------------------------------
[2012-01-02 13:56:27] fernando at consultorpc dot com

Description:
------------
If you try to access a file within a folder that has a dot, an open_basedir 
restriction warning will show up even if the folder is in the allowed paths list.

Test script:
---------------
<?php
// Set open_basedir allowed paths to /home/example:/usr/lib/php:/tmp

file_exists('/home/example/public_html/myfolder.example/file.php'); // This results in a
open_basedir restriction warning

Expected result:
----------------
No warning should show up and i should be able to access the file normally.

Actual result:
--------------
The test script results in:

PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-
exists</a>]: open_basedir restriction in effect. 
File(/home/example/public_html/myfolder.example/file.php) is not within the 
allowed path(s): (/home/example:/usr/lib/php:/tmp) in 
/home/example/public_html/test.php on line 3


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60636&edit=1


Thread (9 messages)

« previous php.bugs (#175659) next »