Bug #81042 [Dup]: open_basedir does not work as it should because of open_basedir
| From: | bugs-php dot a2 at x25 dot pl | Date: | Tue, 18 May 2021 18:08:29 +0000 |
| Subject: | Bug #81042 [Dup]: open_basedir does not work as it should because of open_basedir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233886@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81042&edit=1
ID: 81042
User updated by: bugs-php dot a2 at x25 dot pl
Reported by: bugs-php dot a2 at x25 dot pl
Summary: open_basedir does not work as it should because of
open_basedir
Status: Duplicate
Type: Bug
Package: *Directory/Filesystem functions
PHP Version: 7.4.19
Block user comment: N
Private report: N
New Comment:
And how does it make not open_basedir problem? You are saying that I can't check if file/dir
exists because it might not exist.
Then how about mkdir()? or file_exists() or is_file()? mkdir() cant create directory because it also
does not exist?
cat a.php
<?
ini_set("open_basedir","/home/naox/public_html/test");
mkdir("/home/naox/public_html/test");
php a.php
Warning: mkdir(): open_basedir restriction in effect. File(/home/naox/public_html/test) is not
within the allowed path(s): (/home/naox/public_html/test) in
/home/naox/public_html/naox.vipserv.org/a.php on line 3
Previous Comments:
------------------------------------------------------------------------
[2021-05-15 18:57:57] requinix@php.net
Duplicate of bug #52065
The issue is not open_basedir but that the functionality supporting is_dir() reports that the path
does not exist, and the reason for that is assumed to be an open_basedir restriction. If
public_html/test existed then you would not get this warning.
------------------------------------------------------------------------
[2021-05-15 09:03:23] bugs-php dot a2 at x25 dot pl
No, it does not exist but it should not matter.
------------------------------------------------------------------------
[2021-05-15 01:52:20] requinix@php.net
Does public_html/test exist?
------------------------------------------------------------------------
[2021-05-14 23:35:43] bugs-php dot a2 at x25 dot pl
Description:
------------
open_basedir does not work as it should:
Test script:
---------------
<?
ini_set("open_basedir","/home/naox/public_html/test");
is_dir("/home/naox/public_html/test");
Actual result:
--------------
Warning: is_dir(): open_basedir restriction in effect. File(/home/naox/public_html/test) is not
within the allowed path(s): (/home/naox/public_html/test/) in /home/naox/public_html/a.php on line 3
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81042&edit=1