Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site laidbak.UUCP Path: utzoo!linus!decvax!harpo!ihnp4!laidbak!mark From: mark@laidbak.UUCP (Mark Brukhartz) Newsgroups: net.bugs Subject: Re: XENIX 1.3 and usr/spool - (nf) Message-ID: <194@laidbak.UUCP> Date: Sat, 14-Jan-84 20:03:46 EST Article-I.D.: laidbak.194 Posted: Sat Jan 14 20:03:46 1984 Date-Received: Mon, 16-Jan-84 05:12:41 EST References: <4902@uiucdcs.UUCP> Organization: LAI, Westmont, IL Lines: 36 > Now for the problem : I have found an extremely large file nested within > the usr/spool directory. This file seems to be nothing more than a > directory within a directory within a directory, ad infinitum. > It goes like this ... > > /usr/spool/lpd > /usr/spool/lpd/lfa00047 > /usr/spool/lpd/lfa00047/spool > /usr/spool/lpd/lfa00047/spool/lpd > /usr/spool/lpd/lfa00047/spool/lpd/lfa00047 > . > . > . You have a link from /usr/spool/lpd/lfa00047/spool back to /usr/spool. The easiest way to fix this is with the trivial program: main() { unlink("/usr/spool/lpd/lfa00047/spool"); exit(0); } This will break the link (leaving /usr/spool otherwise intact). I suggest running fsck (or icheck and dcheck) to check the filesystem after the fix. While Unix does prohibit random links to directories, this restriction is enforced outside of the kernel. Only the super-user is allowed to create, remove and link directories. Mkdir(1) and rmdir(1) are set-user-id to root. After making a truly empty directory with mknod(2), mkdir(1) creates links to itself and its parent directory ("." and "..", respectively). This way, the kernel does not know that "." and ".." are at all special (except for an obscure chroot(2) kludge). Mark Brukhartz {allegra,ihnp4,ittral,trsvax}!laidbak!mark