Bug #74016 [NEW]: open_basedir restriction effect when remove and create the same dir
| From: | web_programer at mail dot ru | Date: | Mon, 30 Jan 2017 15:32:45 +0000 |
| Subject: | Bug #74016 [NEW]: open_basedir restriction effect when remove and create the same dir | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-207043@lists.php.net to get a copy of this message | ||
From: web_programer at mail dot ru
Operating system: all
PHP version: 5.6.30
Package: Safe Mode/open_basedir
Bug Type: Bug
Bug description:open_basedir restriction effect when remove and create the same dir
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 bug report at https://bugs.php.net/bug.php?id=74016&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74016&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74016&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74016&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74016&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74016&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74016&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74016&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74016&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74016&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74016&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74016&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74016&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74016&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74016&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74016&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74016&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74016&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74016&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74016&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74016&r=mysqlcfg