XENIX 1.3 and usr/spool - (nf)

Mark Brukhartz mark at laidbak.UUCP
Sun Jan 15 11:03:46 AEST 1984


>	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



More information about the Net.bugs mailing list