Hard links to directories: why not?

Douglas W. Jones,201H MLH,3193350740,3193382879 jones at pyrite.cs.uiowa.edu
Thu Jul 19 06:44:53 AEST 1990


William Lewis asked why UNIX doesn't allow hard links to directories.

I don't think the reason has anything to do with security.  My understanding
of the problem is that it would allow the creation of circularly linked
structures that the crude reference count scheme of UNIX could not deal
with.  UNIX assumes that the only circular linkages in the directory tree
are . and .., and the special services "mkdir" and "rmdir" take care of
these special cases.

The Cambridge CAP file system demonstrated quite effectively that it is
perfectly possible to allow users to create arbitrary linkages between
directories and files, but this worked only because they invented a nice
combination of garbage collection and reference counts to handle the
problem of reclaiming circularly linked grabage.

The CAP file system was capability based, but the decision to allow
directories to be circularly linked is independent of the access control
mechanisms they used on their capabilities.  In UNIX terms, the CAP
file system can be thought of as having an access rights field like that
in each UNIX I-node, but this was stored in the link to the file, so each
link could confer different access rights to the file.

					Doug Jones
					jones at herky.cs.uiowa.edu



More information about the Comp.unix.wizards mailing list