ID: 42832 Updated by: [EMAIL PROTECTED] Reported By: jmboyd at bluebottle dot com -Status: Open +Status: Assigned Bug Type: Directory function related Operating System: Windows 2000 -PHP Version: 5.2CVS-2007-10-03 +PHP Version: 5.2CVS-2008-08-25 -Assigned To: +Assigned To: pajoye New Comment:
Assigned to the windows port maintainer. Previous Comments: ------------------------------------------------------------------------ [2008-08-25 14:56:47] jmboyd at bluebottle dot com Hey, I did provide feedback! Lousy robot. Just tried it again with the latest 5.3.0alpha2-dev build stamped Mon, 25 Aug 2008 10:05:33 -0400, same result. I can post the output if needed, but it's exactly the same as the 18 Aug 5:54pm UTC comment above. ------------------------------------------------------------------------ [2008-08-18 17:54:24] jmboyd at bluebottle dot com Same result with the snapshot (from Mon, 18 Aug 2008 14:03:00 -0400): C:\parentdir\subdir>\php53dev\php -r "foreach(scandir('.') as $f) {echo($f); }" Warning: scandir(.): failed to open dir: Bad file descriptor in Command line code on line 1 Warning: scandir(): (errno 9): Bad file descriptor in Command line code on line 1 Warning: Invalid argument supplied for foreach() in Command line code on line 1 ------------------------------------------------------------------------ [2007-10-04 01:59:28] jmboyd at bluebottle dot com Same result with the snapshot (from 03 Oct 2007 20:09:47): C:\parentdir\subdir>\php525dev\php -r "foreach(scandir('.') as $f) { echo($f); }" Warning: scandir(.): failed to open dir: Bad file descriptor in Command line code on line 1 Warning: scandir(): (errno 9): Bad file descriptor in Command line code on line 1 Warning: Invalid argument supplied for foreach() in Command line code on line 1 ------------------------------------------------------------------------ [2007-10-02 17:57:35] jmboyd at bluebottle dot com Description: ------------ A user must have permissions for a directory's parent in order to scan it with scandir. If the user does not have permissions (for instance, user has "Full Control" over the subdir but is not in the parent's ACL at all), php fails with a "failed to open dir: Bad file descriptor" error followed by a "(errno 9): Bad file descriptor" error. Based on the quick test in the "Actual results" box below, this bug seems to have arrived between 5.2.1 and 5.2.2. No php.ini is in use in any of the tests. Reproduce code: --------------- Any use of scandir will work, here's a quick one to do from the command line, after cding to the subdir: php -r "foreach(scandir('.') as $f) { echo($f); }" Expected result: ---------------- The subdirectory's filenames (all run together): ...file1.txtfile2.txtfile3.txt Actual result: -------------- C:\>cd \parentdir Access is denied. C:\>cd \parentdir\subdir C:\parentdir\subdir>dir /B file1.txt file2.txt file3.txt C:\parentdir\subdir>\php521\php -r "foreach(scandir('.') as $f) { echo($f); }" ...file1.txtfile2.txtfile3.txt C:\parentdir\subdir>\php522\php -r "foreach(scandir('.') as $f) { echo($f); }" Warning: scandir(.): failed to open dir: Bad file descriptor in Command line code on line 1 Warning: scandir(): (errno 9): Bad file descriptor in Command line code on line 1 Warning: Invalid argument supplied for foreach() in Command line code on line 1 C:\parentdir\subdir>\php524\php -r "foreach(scandir('.') as $f) { echo($f); }" Warning: scandir(.): failed to open dir: Bad file descriptor in Command line code on line 1 Warning: scandir(): (errno 9): Bad file descriptor in Command line code on line 1 Warning: Invalid argument supplied for foreach() in Command line code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42832&edit=1