MJ Ray markj@cloaked.freeserve.co.uk writes:
(it's late and I'm fuzzy on the exact meaning of the x bit for directories).
The 'w' bit affects the following operations: * creation of files in the directory * removal of files in the directory * renaming of files into or out of the directory * linking of files into the directory ... you get the idea. That's simple enough.
The 'r' bit affects open() on a directory, and thus opendir(). So to list a directory you need 'r' permission on it (but see below).
It _doesn't_ affect access to files in the directory - but you may have to guess their names.
The 'x' bit affects looking up names in a directory (for instance, to open them) and also chdir to the directory; IIRC the spec calls it "search" permission. So to access files within a directory you need 'x' permission on it.
This results in inconsistent effects, because some of the things that you think are listing the directory actually involve accessing a file within it:
t@rollercoaster$ ls -ld . ls: .: Permission denied t@rollercoaster$ ls -ld `/bin/pwd` drw-rw-r-- 2 rjk rjk 4096 Jan 16 11:28 /home/rjk/junk/t t@rollercoaster$
... the ls command can't lstat "." because that involves looking up the name "." in the current directory, and that has no 'x' bit. A UNIX implementation that special-cased "." and ".." might plausibly behave differently here.
But the second ls is fine, as it's looking up the name "t" in "junk", which _does_ have an 'x' bit.