Xref: utzoo comp.unix.wizards:23001 alt.security:1144 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cs.utexas.edu!chinacat!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.wizards,alt.security Subject: Re: Hard links to directories: why not? Message-ID: <18467@rpp386.cactus.org> Date: 22 Jul 90 21:37:08 GMT References: <5222@milton.u.washington.edu> <10527@odin.corp.sgi.com> <1990Jul19.121048.16332@cbnews.att.com> <1990Jul22.111334.9996@jarvis.csri.toronto.edu> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Distribution: na Organization: Lone Star Cafe and BBS Service Lines: 32 X-Clever-Slogan: Recycle or Die. In article <1990Jul22.111334.9996@jarvis.csri.toronto.edu> flaps@dgp.toronto.edu (Alan J Rosenthal) writes: >Suppose your filesystem is on /mnt. >Do this: > > mkdir /mnt/a > ln /mnt/a /mnt/b > mkdir /mnt/a/c > ln /mnt/a /mnt/b/c/d > >Now /mnt/a/c/d and /mnt/a are the same. So you can refer to >/mnt/a/c/d/c/d/c/d/c/d/c/d, etc. Your example is correct - unless /mnt/b/c resolves to /mnt/a/c, the test will fail. This can happen because the order of entries in the directory affects the outcome of the conversion to an absolute pathname. The conversion of /mnt/a and /mnt/b/c/d to absolute pathnames need only recognize that /mnt/a and /mnt/b are identical to know that a loop is being created. If "/mnt/a" is resolved either "/mnt/a" or "/mnt/b" should be produced. Performing the same test on "/mnt/b/c" will produce the same prefix since the resolution of "/mnt/b" and "/mnt/a" can implemented in such a way as to produce the same result. It is quite possible to detect the creation of loops in the filesystem, but the expense and risk doesn't seem worth the questionable benefit of being able to create randomly shaped directory trees. -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org