On Friday 28 December 2001 22.16, Rick Green wrote:
Thank you for the explanation. That helps a lot.
I guess I need to do some reading on the internal structure of ext2. This statement confused me:
On 28 Dec 2001, Alexandr Malusek wrote:
Keep in mind that access is not granted according to the file's permissions (stored in the inode) only. Permissions of all directories in the file's full path are taken into account too. (So the answer to your question is no.)
I was thinking that the 'inode' was roughly equivalent to the 'FAT' in the dos world, and contained nothing more than a pointer to a physical cluster(s). So the directory contains a name and owner, pointing to an inode, which contains permissions, and points to a physical sector? I thought inodes were more or less tied to a physical cluster, kinda like the FAT If the permissions of the parent directories are important, then it seems the access to a linked file is much more complicated than necessary. A hard link points directly to an inode, which may be in a much different part of the filesystem tree (although on the same partition).
An inode isn't in the filesystem tree. An inode is on a partition, and has one or more hardlinks pointing at it in the filesystem tree. Ownership and permissions are in the inode only.
So if I'm accessing /home/rtg/bin/foo which is a link to /usr/X11/bin/bar, I chase the filesystem down the directory path to /home/rtg/bin/foo, then get a pointer to inode 12345. At this point, how am I supposed to find out what the 'real' parent directories of this file are? Does the inode also contain reverse or upward pointers to its parents?
There is no 'real' parent. There is absolutely no difference between two hardlinks, in the sense that there is no 'real' and 'false' link. Both are links to an inode, that is all. regards Anders