Mailinglist Archive: opensuse-security (226 mails)
| < Previous | Next > |
Re: [suse-security] Re: Strange links, /usr/bin/[ ?
- From: "Carlos E. R." <robin1.listas@xxxxxxxxxx>
- Date: Wed, 6 Apr 2005 04:11:13 +0200 (CEST)
- Message-id: <Pine.LNX.4.58.0504060400500.7853@xxxxxxxxxxxxxxxx>
The Monday 2005-04-04 at 20:03 -0700, Randall R Schulz wrote:
> On Saturday 02 April 2005 03:10, Carlos E. R. wrote:
> > ...
> >
> > Quick question:
> >
> > Is there an easier way to list hardlinks, than comparing inode
> > numbers?
>
> No. Directory entries associate names with inodes (implicitly sharing
> the same file system device, which accounts for the prohibition on
> cross-device links). Each reference to a particular inode is a name for
> the file (or other file system entity). It's not as if one's the
> "original" or "real" file and the other(s) are the links. They're all
> coequal names for the same file system entity. This is in contrast to
> symbolic links, in which there's a fundamental distinction between the
> (symbolic) link and the target.
>
> So the only way to find what names refer to the same inode is to
> enumerate directory entries and compare inode numbers.
Ah, I see. So it is not easy as well to know if a file somewhere is
hardlinked somewhere else, except by comparing all inode entries in all
directory lists from the same partition/disk.
Do you know of a (brief) description of how a inode fs works, somewhere? I
come from Dos; I did study how FAT worked in detail, but unix was out of
bounds for me at the time, and later I had no occasion to study ext2 or
similar. So, although I have some inkling of what an inode is, I really
don't know O:-)
--
Cheers,
Carlos Robinson
| < Previous | Next > |