#38827 [Opn->Bgs]: mkdir fails with links and open_basedir restriction

From: Date: Mon, 25 Sep 2006 13:32:37 +0000
Subject: #38827 [Opn->Bgs]: mkdir fails with links and open_basedir restriction
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102641@lists.php.net to get a copy of this message
ID: 38827 Updated by: tony2001@php.net Reported By: kore@php.net -Status: Open +Status: Bogus Bug Type: Directory function related Operating System: Solaris 8 PHP Version: 5.2.0RC3 New Comment: Actually it doesn't work on ALL systems because of this: open_basedir = ' value ' is not the same as open_basedir = "value" Pay attention to this part of the error message: File(/path/htdocs/var/testdir) is not within the allowed path(s):------->('/path/htdocs:/path/var')<-------- Apparently /path/htdocs/var/testdir IS NOT within the "'/path/htdocs" directory. Previous Comments: ------------------------------------------------------------------------ [2006-09-14 12:35:19] kore@php.net Description: ------------ mkdir() will fail, if open_basedir restricts the access to a path which is only a link, but not a real path. Reproduce code: --------------- Directory structure: /path/ `- htdocs/ `- mkdir.php `- var/ -> /path/var `- var/ Ini settings: open_basedir = '/path/htdocs:/path/var'; Code: (mkdir.php) <?php // This will work on Linux, BSD, but not on Solaris mkdir('/path/htdocs/var/testdir'); Expected result: ---------------- Creating the directory. Actual result: -------------- Warning: mkdir(): open_basedir restriction in effect. File(/path/htdocs/var/testdir) is not within the allowed path(s): ('/path/htdocs:/path/var') in /path/htdocs/mkdir.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38827&edit=1

« previous php.bugs (#102641) next »