Edit report at https://bugs.php.net/bug.php?id=65482&edit=1
ID: 65482
Updated by: cmb@php.net
Reported by: lukl at eabrno dot cz
Summary: fileperms function reports wrong permissions on a
file with ACL
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
Package: Filesystem function related
Operating System: Linux CentOS 6.4
PHP Version: 5.4.18
Block user comment: N
Private report: N
New Comment:
Confirmed. This is because fileperms() basically does a stat()
call, which doesn't actually check the ACLs. This needs to be
documented. See also bug #43817.
Previous Comments:
------------------------------------------------------------------------
[2013-08-20 03:25:32] 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);
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65482&edit=1