I have encountered strange behavior. When I ask the listing of the root directory under the rights of apache user, I see the different picture then I see when the same command is issued by Python and displayed on the web page.
Here is the first listing
Code:
[root@telesmi ~]# sudo -u apache ls -l /
total 150
drwxr-xr-x 2 root root 4096 2009-03-03 04:11 bin
drwxr-xr-x 5 root root 1024 2008-07-24 13:34 boot
drwxr-xr-x 4 root root 4096 2009-03-03 08:59 d4m
drwxr-xr-x 12 root root 4120 2009-03-03 09:20 dev
drwxr-xr-x 97 root root 12288 2009-03-03 09:20 etc
drwxr-xr-x 2 root root 4096 2009-03-03 09:02 fff
drwxr-xr-x 2 root root 4096 2009-03-03 10:02 ggg
drwxr-xr-x 2 root root 4096 2008-04-07 17:44 home
drwxr-xr-x 15 root root 12288 2009-03-02 08:00 lib
-rw-r--r-- 1 root root 34834 2009-03-02 08:31 libdrutils.a
drwx------ 2 root root 16384 2008-07-18 22:40 lost+found
drwxr-xr-x 2 root root 4096 2008-04-07 17:44 media
drwxr-xr-x 2 root root 4096 2008-04-07 17:44 mnt
drwxr-xr-x 2 root root 4096 2009-03-03 02:47 opt
drwxr-xr-x 2 root root 4096 2009-02-27 11:10 prj
dr-xr-xr-x 111 root root 0 2009-03-03 09:20 proc
drwxr-x--- 15 root root 4096 2009-03-03 19:06 root
drwxr-xr-x 2 root root 12288 2009-02-11 04:11 sbin
drwxr-xr-x 7 root root 0 2009-03-03 09:20 selinux
drwxr-xr-x 2 root root 4096 2008-04-07 17:44 srv
drwxr-xr-x 11 root root 0 2009-03-03 09:20 sys
drwxrwxrwt 5 root root 4096 2009-03-03 10:10 tmp
drwxr-xr-x 13 root root 4096 2008-07-18 22:46 usr
drwxr-xr-x 20 root root 4096 2008-07-18 22:48 var
And here is the listing of the command ls -l / as it is seen by Python:
Code:
total 100
drwxr-xr-x 2 root root 4096 Mar 3 04:11 bin
d????????? ? ? ? ? ? boot
d????????? ? ? ? ? ? d4m
drwxr-xr-x 12 root root 4120 Mar 3 09:20 dev
drwxr-xr-x 97 root root 12288 Mar 3 09:20 etc
d????????? ? ? ? ? ? fff
drwxr-xr-x 2 root root 4096 Apr 7 2008 home
drwxr-xr-x 15 root root 12288 Mar 2 08:00 lib
-rw-r--r-- 1 root root 34834 Mar 2 08:31 libdrutils.a
d????????? ? ? ? ? ? lost+found
d????????? ? ? ? ? ? media
d????????? ? ? ? ? ? mnt
drwxr-xr-x 2 root root 4096 Mar 3 02:47 opt
d????????? ? ? ? ? ? prj
dr-xr-xr-x 115 root root 0 Mar 3 09:20 proc
d????????? ? ? ? ? ? root
drwxr-xr-x 2 root root 12288 Feb 11 04:11 sbin
d????????? ? ? ? ? ? selinux
drwxr-xr-x 2 root root 4096 Apr 7 2008 srv
d????????? ? ? ? ? ? sys
drwxrwxrwt 4 root root 4096 Mar 3 09:22 tmp
drwxr-xr-x 13 root root 4096 Jul 18 2008 usr
drwxr-xr-x 20 root root 4096 Jul 18 2008 var
Evidently, that it can't see even access rights, owners, modification times etc.
Why?
Also, if I ask to list some directory inside one of these strange directories, I get the following error (for example)
ls: cannot access /d4m: Permission denied
while normal lack of access usually gives the following message
ls: cannot open directory /root: Permission denied
What is the difference between "cannot access" and "cannot open directory"?
Thanks.