#28355 [Csd->Bgs]: glob wont error if dir is not readable
| From: | hholzgra@php.net | Date: | Sun, 12 Jun 2005 00:55:35 +0000 |
| Subject: | #28355 [Csd->Bgs]: glob wont error if dir is not readable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-80191@lists.php.net to get a copy of this message | ||
ID: 28355
Updated by: hholzgra@php.net
Reported By: trancer at trancer dot nl
-Status: Closed
+Status: Bogus
Bug Type: Directory function related
Operating System: Linux
PHP Version: 4.3.6
Assigned To: hholzgra
New Comment:
The C library implementation of glob() does not distinguish between
empty and non-readable directories (at least not on the unixoid
systems i tested on) and so PHP glob() doesn't do it either.
The previos 'fix' for this bud didn't actually change the functions
behavior and is going to be reverted.
Previous Comments:
------------------------------------------------------------------------
[2004-05-11 15:35:00] iliaa@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-05-11 01:31:57] trancer at trancer dot nl
Description:
------------
If the dir isnt readable by the webserver (apache in my case) glob()
wont list a thing. Glob wont return an error like 'permission denied'
though alike other functions do.
It would be nice to see that when glob() cant read the directory it
will return an error or a notice.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
print_r(glob('*.png'));
?>
The dir in which the png file was, was chmodded to 711 so apache only
had execution rights.
Expected result:
----------------
Warning: permission denied ....
Array( )
Actual result:
--------------
Array( )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28355&edit=1