I'm currently working on a PHP server explorer, and I have to determine if a directory is empty or not readable because of insufficient permission.
My web application is running under the user
apache, and I can see that my application can access to a folder that it cannot read according to the directory mode.
Permissions look like this:
ls -al drwxr-x--- 8 laura jpGrp 4096 Aug 10 09:40 dir1
Here are the content of jpGrp:
cat /etc/group | grep "jpGrp" jpGrp:x:501:laura,lola,gerard
Here are the content of apache user :
grep apache /etc/passwd apache:x:48:48:Apache:/var/www:/sbin/nologin
Apache is not in root groupe :
cat /etc/group | grep "root" root:x:0:root
var_dump from shell_exec("whoami") php function :
string 'apache' (length=7)
A friend tell me to see the ACL, but there is nothing that could override the standard Unix modes.
So: why can Apache open this directory (dir1)? (That's my question)