Bug->Doc #65482 [Opn->Ver]: fileperms function reports wrong permissions on a file with ACL

[email protected]
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=65482&edit=1

 ID:                 65482
 Updated by:         [email protected]
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.