ID: 43817 Updated by: paj...@php.net Reported By: losd at mail dot dk Status: Assigned Bug Type: Directory function related Operating System: Windows Server 2003 PHP Version: 5.3.0beta1 Assigned To: pajoye New Comment:
I can now reproduce it on XP, but not on 2008/Vista/win7. I have to investigate deeper :P Previous Comments: ------------------------------------------------------------------------ [2009-02-03 17:36:35] dani...@php.net Changing version from 5.2.5 to 5.3.0beta1 to facilitate this getting fixed before the next release. ------------------------------------------------------------------------ [2009-02-03 15:31:49] dani...@php.net This problem still exists in 5.3.0 beta 1 (http://windows.php.net/downloads/qa/php-5.3.0beta1-Win32-VC6-x86.zip) ------------------------------------------------------------------------ [2008-08-12 09:42:06] dmi...@php.net Fixed in CVS HEAD and PHP_5_3. ------------------------------------------------------------------------ [2008-03-01 09:09:15] losd at mail dot dk Doh, sorry, thought I could edit the original text. Just delete that comment. But yes, as Daniel correctly points out, it's all Windows permission handling (As my reproduce code also shows), not just related to network shares... I experienced it in one at first, I guess that's why it stuck in my brain. ------------------------------------------------------------------------ [2008-03-01 09:02:02] losd at mail dot dk Description: ------------ If the parent directory of a Windows directory is not accessible, you are still able to access subdirectories if given explicit permission. However, PHP has trouble with the first accessible directory below an inaccessible directory. This is not a problem for the accessible dir's subdirs, though. Scenario: C:/Test/NoAccess/ -- Not accessible Access/ -- Accesible from here yyyyyyy.txt Subdir/ xxxxxxx.txt The problem has been found with opendir(), is_dir() and is_readable(). All directory functions are probably affected. No workarounds has been found so far (suggestions appreciated). Reproduce code: --------------- <?php if ($handle = opendir("C:/Test/NoAccess/Access/Subdir")) { echo "Opened dir C:/Test/NoAccess/Access/Subdir<br/>"; while (false !== ($file = readdir($handle))) echo"File: $file<br/>"; closedir($handle); } else { echo "Hmmmm, can't open directory, is it accessible?<br/>"; } echo "<br/>"; if ($handle = opendir("C:/Test/NoAccess/Access")) { echo "Opened directory C:/Test/NoAccess/Access<br/>"; while (false !== ($file = readdir($handle))) echo"File: $file<br/>"; closedir($handle); } else { echo "Hmmmm, can't open directory, is it accessible?<br/>"; } ?> Expected result: ---------------- Opened dir C:/Test/NoAccess/Access/Subdir File: . File: .. File: xxxxxxx.txt Opened dir C:/Test/NoAccess/Access File: . File: .. File: yyyyyyy.txt File: Subdir Actual result: -------------- Opened dir C:/Test/NoAccess/Access/Subdir File: . File: .. File: xxxxxxx.txt Warning: opendir(C:/Test/NoAccess/Access) [function.opendir]: failed to open dir: No such file or directory in C:\Inetpub\wwwroot\pm2\opendir.php on line 13 Hmmmm, can't open directory, is it accessible? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/43817 -- Edit this bug report at http://bugs.php.net/?id=43817&edit=1