Bug #74016 [Opn->Dup]: open_basedir restriction effect when remove and create the same dir

From: Date: Thu, 20 May 2021 15:43:32 +0000
Subject: Bug #74016 [Opn->Dup]: open_basedir restriction effect when remove and create the same dir
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233922@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74016&edit=1 ID: 74016 Updated by: cmb@php.net Reported by: web_programer at mail dot ru Summary: open_basedir restriction effect when remove and create the same dir -Status: Open +Status: Duplicate Type: Bug Package: Safe Mode/open_basedir Operating System: all PHP Version: 5.6.30 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This has nothing to do with deleting and recreating the directory, but is rather a general issue of GlobIterator and open_basedir, see bug #65069. Previous Comments: ------------------------------------------------------------------------ [2017-02-01 13:05:44] web_programer at mail dot ru "C:/apache and so on". It does not depends on concrete setting^ Globiterator fine works with dir where script is (because open_basedir setting allows it), but after rmdir and create the same this dir it doesn't: restriction ------------------------------------------------------------------------ [2017-02-01 09:00:17] andrew dot nester dot dev at gmail dot com What is your open_basedir setting? ------------------------------------------------------------------------ [2017-01-30 15:32:41] web_programer at mail dot ru Description: ------------ Fatal error: Uncaught exception 'UnexpectedValueException' with message 'GlobIterator::__construct(): open_basedir restriction in effect When remove and create dir where script is situated. When simply use GlobIterator on any dirs, there are no problems. Test script: --------------- //in testdir/test.php $root = $_SERVER['DOCUMENT_ROOT'].'/testdir'; $filetext = file_get_contents(__FILE__); unlink(__FILE__); rmdir($root); mkdir($root, 0777); file_put_contents(__FILE__, $filetext); clearstatcache(); $iterator = new GlobIterator($root.'/*.sql'); print_r($iterator); Expected result: ---------------- GlobIterator Object ( [pathName:SplFileInfo:private] => [glob:DirectoryIterator:private] => ........... Actual result: -------------- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'GlobIterator::__construct(): open_basedir restriction in effect ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74016&edit=1

« previous php.bugs (#233922) next »