ok what is the signifigance of the -l that wont let you list the contents of a directory you clearly have access to list files. what am i missing
[qgatu003]/tmp$ls -l hold
hold/file1: Permission denied
total 0
[qgatu003]/tmp$ls hold
file1
[qgatu003]/tmp$ls -l
dr-x---r-- 2 root other 179 Apr 23 09:18 hold
edit::
i want to say its because i can not read the inode information from the file. does the system need to pull you to the files current directory in order to gets its full list of required arguments?......
yeah i know if i add o+x i can list it. but why do you need to be able to enter the directory in order to read its contents is what i am trying to get at.
mabey i am not seeing the big picture or something but if you have read permission on a directory you should be able to list the file in all forms. apparently you need to be able to enter the directory to beable to read its inode information .... which i dont understand as to why.
Instead of x meaning search, think of it as "use" a directory.
With r permission only, you can list the files in a directory but you can't open them or stat them. And you can't cd to the directory either. The directory is reduced to being just a list filenames. It has sorta lost the special status that directories have.
With x permission only, you can cd to a directory but you can't list the files. If you happen to know a filename, you can open (file permissions allowing) or stat that file.
By the way, stat'ing a file is required for ls -l. stat'ing a file is also how "ls" gets an inode number. So "ls -i" needs x permission as well.
I don't think it makes sense to give a user just r or x on a directory. With me, it's always both or none.
I assume that this a directory that you don't own so that you are relying the 4 of 504.
The reason is that the stat system call is not working. Remember that a directory is just a list of filenames and inode numbers. Until you stat the the file, there is no way to know its size, owner, group, etc.
Why do you have to accept it? I guess you don't. But besides accepting it, what other choices do you see? Switch to another OS? Rewrite the kernel? Lobby for a change? Personally, I'd just live with it...
well... i do own it cuz i am the admin but i was just doing an exersize and came across it.
well after reading the man page for stat it just planly layes it out. You need to be able to use/execute the directory in order for the stat function to work.
DESCRIPTION
The stat() function obtains information about the file
pointed to by path. Read, write, or execute permission of
the named file is not required, but all directories listed
in the path name leading to the file must be searchable.
as far as accepting it. why accept anything because someone says so. shouldnt you always question something to find out how it works. ie: dont blindly accept