You need execute permission on a directory to cd to it! Is read not enough? In practice, no. The chdir system call requires execute permission to make that directory the starting point for path searches. According to the chdir (system call, section 2) man page:
For a directory to become the current directory, a process
must have execute (search) access to the directory.
So when trussing the output of a failed cd to a directory with no execute permissions we see:
chdir("lala") Err#13 EACCES [file_dac_search]
chdir(”lala”) Err#13 EACCES [file_dac_search]
and as the man page goes on to say:
EACCES Search permission is denied for any com-
ponent of the path name.
Reading this article explains, that of course you can’t execute a directory but rather, that the execute permission bit is reused for different purposes. Without execute permission on the directory, you can’t stat() any files within the directory. Opening, deleting and other operations on a file first require you to stat() it first, as stat() gives you the files inode. Without the files inode, theres very little you can do with it!
Armed with this knowledge you might feel inspired to check out the source code of this call for yourself!
Could anyone tell me the name of the owner or manager of this website?
Hi linda, the owner is Anton Parol, me! You can find out more at
http://www.parolski.com/about