Xref: utzoo comp.unix.wizards:23072 alt.security:1193 Path: utzoo!mnetor!geac!torsqnt!news-server.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Newsgroups: comp.unix.wizards,alt.security Subject: Re: Hard links to directories: why not? Message-ID: <1990Jul25.115628.6385@jarvis.csri.toronto.edu> Date: 25 Jul 90 15:56:28 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> <18467@rpp386.cactus.org> Distribution: na Lines: 18 jfh@rpp386.cactus.org (John F. Haugh II) writes: >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. ... >It is quite possible to detect the creation of loops in the filesystem... I certainly wasn't claiming it wasn't computable to determine whether or not a new link caused a loop in the filesystem. However, the original article's method was faulty as I illustrated. "/mnt/a" is certainly an absolute pathname, even if due to abnormalities in the filesystem it is not canonical in some sense. Once absolute pathnames were obtained, it advised using strncmp(), which certainly doesn't think that /mnt/a is an initial string of /mnt/b/c/d. Do you have a method for detecting loops which doesn't involve searching the whole i-list or the whole file graph?