If I have a folder specified as not-readable. Are all folders under it also non-readable? For example, my shared hosting home account directory is not accessible to other accounts, so, are all folders and files that are 0777 under that home account directory non-accessible, too?
feedback
|
|
Directories have two different read permissions. You have the standard read permission, like you do with files. This stops you from doing an opendir()/readdir() on the directory. This basically stops you from doing an ls in the directory. You can still access subdirectories if you know the name of them. You also have the execute permission, which in the case of directories prevents you from accessing the files inside them. You can not change directory to a directory you don't have execute permission for and you can not access anything under it, but you can still read the contents.
You'll notice that the | ||||
|
feedback
|
|
The answer is "Yes". If, for example /foo is mode | |||||
feedback
|
|
This depends on the implementation, but in most modern unixes preventing access to the parent folder will also prevent access to the subfolders, regardless of their individual permissions.
If you wish to give access to subfolders you could set the execute bit on the parent folder.
As you can see, this prevents listing of the parent folder, but allows access to the subfolder and files. | ||||
|
feedback
|
|
You can read a directory whose parent is not readable:
Directory permissions are not what you think though (from what I gather from your post): Execute (Search) -- Enter into a directory Execute (search) does require that all the parents have execute set, unlike read and write. This is an example of Why it is important to understand directory permissions: | ||||
feedback
|