php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29615 is_writable / is_readable / is_executable should use access() instead of stat()
Submitted: 2004-08-11 16:01 UTC Modified: 2005-01-07 17:10 UTC
From: liamr at umich dot edu Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.0.0 OS: linux
Private report: No CVE-ID: None
 [2004-08-11 16:01 UTC] liamr at umich dot edu
Description:
------------
The filesystem commands is_writable / is_readable / is_executable are now using stat() instead of access(), which doesn't return accurate results in a number of situations:

    - on many network filesystems
    - if the system uses ACLS
    - if you have more groups than just initgroups

The current version only works on simple (unextened) unix filesystem - filesystems that only use the traditional unix octets for access control.

the filesystem commands that check file system access should be based on access() instead of stat():

http://www.opengroup.org/onlinepubs/009695399/functions/access.html

Acc'd to CVS the is_writable stuff changed when php_stat was routed through the streams API:

http://cvs.php.net/diff.php/php-src/ext/standard/filestat.c?r1=1.127&r2=1.128&ty=h

There's a bug report from a couple of years ago that suggests adding an access() command to the posix extention:

http://bugs.php.net/bug.php?id=14924

If you want to keep the functionality gained by routing php_stat through the streams API, how about offering access() through the posix commands?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-07 17:10 UTC] magnus@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.

posix_access() have been added.
Will be in 5.1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:02:40 2024 UTC