php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28355 glob wont error if dir is not readable
Submitted: 2004-05-11 01:31 UTC Modified: 2005-06-12 02:55 UTC
From: trancer at trancer dot nl Assigned: hholzgra (profile)
Status: Not a bug Package: Directory function related
PHP Version: 4.3.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: trancer at trancer dot nl
New email:
PHP Version: OS:

 

 [2004-05-11 01:31 UTC] 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( )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-12 02:55 UTC] hholzgra@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC