Subject: Re: link(1) - when did it disappear?
To: Christos Zoulas <christos@zoulas.com>
From: Gandhi woulda smacked you <greywolf@starwolf.com>
List: tech-userlevel
Date: 07/18/1999 13:29:09
On Sun, 18 Jul 1999, Christos Zoulas wrote:

# In article <199907181610.SAA08983@orade.oreilly.de>,
# Christoph Badura <bad@oreilly.de> wrote:
# >lucio@cackle.proxima.alt.za (Lucio De Re) writes:
# >>Well, I think one of NetBSD's good points is its liberal approach: "Give
# >>them enough rope..." type thing.  This is a piece of rope I really want
# >>quite badly.
# >
# >>So where are the policy makers on this Sunday morning/Saturday night?
# >
# >The last time I remember this came up the policy makers decided that they
# >don't want to sell that much rope, so to speak.
# 
# And with a good reason. Hard linking to directories changes the link count
# in directory inodes which can create pathological that fsck cannot fix thus
# you are able now to corrupt your filesystem beyond repair. The second reason
# is that now you can create cycles in the filesystem graph, making programs
# that traverse the tree to never terminate.
# 
# If you really want to do it, write your own link program; make sure that you
# write an unlink with it so that you can clean up the mess :-)

main(int ac, char **av)
{
	int rv = link(av[1], av[2]);
	if (rv < 0) {
		perror("link");
	}
}

starwolf# cc link.c -o link
starwolf# mkdir a b
starwolf# ./link b a/c
link: Operation not permitted
starwolf#

It seems that link() does not allow linking of directories any more.

# 
# christos
# 

				--*greywolf;
--
NetBSD: true inheritors of the UNIX(tm) legacy.