🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #1150

Linking to Unix dirs (was Re: toolpath wanted in workbench 1.4)

#1150
From: Doug Merritt
Date: Wed, 06 Sep 1989 15:19
63 lines
3619 bytes
>Lehtinen Pertti: Unix doesn't allow you make hard links to directories.
>Peter da Silva: But it does.
>Ronald Minnich: The last version of Unix that allowed you to was long ago.
>Fred Fish: <Example of how to link a dir>
>David Donley: On HP-UX systems you have to be superuser to link directories.

There seems to be a lot of confusion on the subject, so let's straighten
this out.
	1) Unix does not allow ordinary users to make links to directories,
	   because of the necessity of retaining a pure tree structure.
	   This has been true at least since 1975, and probably right from
	   the start.

	2) As part of its fundamental design, Unix implements some of
	   its features via "trusted user processes" rather than directly
	   in the kernel (this general approach is a feature, BTW).

	   In particular, the process of creating a new directory inherently
	   involves making links to directories, because the entry "."
	   (synonym for "current directory") is created by linking the
	   directory to the entry "." within itself. Also the entry ".."
	   (synonym for "parent directory") is created by linking the
	   parent directory to the entry ".." within the new directory.

	   This is accomplished by having the "mkdir" command run as
	   superuser, meaning it is a trusted user process authorized
	   to implement and enforce OS design policy, so it is allowed
	   to make such links to directories as part of the ordinary
	   process of creating new directories.
	
	3) The "ln" utility is just a simple wrapper around the "link"
	   system call. On some Unix systems that's all there is to it,
	   so that a superuser can use "ln" to link directories if he
	   wishes. He's not a user, he's an extension of OS policy, so
	   he's trusted to do as he pleases.

	   Some Unix systems recognize that human beings are imperfect,
	   and have added checking to "ln" to enforce "no links to directories"
	   even for the superuser. Even on such systems, the superuser
	   can write a trivial C program encapsulating the "link"
	   system call, and use *that* to make links to directories if
	   he really wants to.
	
	4) A very, very few Unix systems, such as Gould's, have totally
	   changed the way all of this sort of thing works, in the name
	   of achieving great enough theoretical security so as to sell
	   their systems to "secure" government facilities. Purists claim
	   that such changes mean that it's no longer Unix (but what's
	   in a name?)
	
	5) Links are *not* "a slow substitute for aliases", unless you're
	   widening the definition of "alias" to include link-like objects,
	   in which case it's still a nonsensical statement.
	   Off the cuff opinions about things you know nothing about
	   are no substitute for precise reasoning about design tradeoffs.
	   Links have both good and bad points; it reflects much better
	   on a poster if he shows he has knowledge of those tradeoffs, not
	   just uninformed opinions.

-Doug-
-- 
Doug Merritt		{pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow		Professional Wildeyed Visionary
Technical Details
Message-ID: <444@xdos.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!motcsd!xdos!doug
References: <19465@gryphon.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!motcsd!xdos!doug
From: doug@xdos.UUCP (Doug Merritt)
Newsgroups: comp.sys.amiga.tech
Subject: Linking to Unix dirs (was Re: toolpath wanted in workbench 1.4)
Summary: Some concrete information
Message-ID: <444@xdos.UUCP>
Date: 6 Sep 89 15:19:17 GMT
References: <19465@gryphon.COM>
Reply-To: doug@xdos.UUCP (Doug Merritt)
Organization: Hunter Systems, Mountain View CA (Silicon Valley)
Lines: 63