Dec 28
刚才在#gentoo-cn 的irc里有个Guest10086的人问为啥一个目录需要(+x)execute权限,可能很多人都会觉得奇怪.为什么需要.记得以前也有过同样的疑问.今天google了一把找到了原因.
The chdir() system call requires execute permission on a directory. Of course a directory isn't really a program that you can run, even if it has execute permission. The execute bit is reused rather than waste space with additional permission bits. Besides controlling a user's ability to cd into some directory, the execute permission is required on a directory to use the stat() system call on files within that directory. The stat() system called is used to access the information in a file's inode, and must be done before you can open or delete (via the unlink() system call) that file. Because of its role in file access the execute bit on a directory is sometimes called search permission. For example, to read a file foo/bar, you must have read permission



