php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65482 fileperms function reports wrong permissions on a file with ACL
Submitted: 2013-08-20 03:25 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lukl at eabrno dot cz Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.4.18 OS: Linux CentOS 6.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-08-20 03:25 UTC] lukl at eabrno dot cz
Description:
------------
Executing a code bellow for a file/directory with extended permissions (ACL) 
return wrong results.
E.g. a file with these ACLs (display permissions using OS getfacl command):

# file: file
# owner: user
# group: apache
user::rwx
group::r-x
group:webmasters:rwx
group:users:rwx
mask::rwx
other::---

The PHP code however returns 0757, which is weird (other has no permissions at 
all, but according fileperms it has rwx).

When I clear any extended permissions, the PHP code returns expected result of 
0750.

Test script:
---------------
<?php

echo substr(decoct( fileperms("file") ) , 2);

?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Jul 16 10:01:53 2018 UTC