php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14924 The POSIX access(2) function is not available
Submitted: 2002-01-07 22:40 UTC Modified: 2005-01-07 17:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: danpat at au dot adaptiveinterantional dot com Assigned: yohgaki (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.0 OS: Linux 2.4.17, Debian unstable
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: danpat at au dot adaptiveinterantional dot com
New email:
PHP Version: OS:

 

 [2002-01-07 22:40 UTC] danpat at au dot adaptiveinterantional dot com
Seeing as is_readable, is_writeable and is_executable all
work out the file permissions masks themselves, it might
be nice to have access to the posix function access(2) so that
file permissions in situations where mask comparision is
not sufficient (e.g. when using POSIX ACL's on the filesystem,
such as is available with SGI's XFS on Linux and Irix).

It should simply be a matter of (in ext/posix/posix.c

  #include <unistd.h>
  ....
  PHP_FE(posix_access, NULL)
  ....

  /* {{{ proto bool posix_access(string filename, int mode)
   check user's permissions for a file */
  PHP_FUNCTION(posix_access)
  {
    char *filename = NULL;
    int argc = ZEND_NUM_ARGS();
    int mode = 0;
    if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &filename, &mode) == FAILURE)
      return;

    if (access(filename, mode) != 0) {
      php_error(E_WARNING,"posix_access: error checking access for %s: %s", filename, strerror(errno));
    } else {
      return 0;
    }
  }
 
As far as I can see, access() has always been a POSIX function.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-07 17:09 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.

Will be in PHP 5.1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 08:02:42 2024 UTC