Subject: NetBSD current /bin/ln bug?
To: NetBSD Amiga-Dev <amiga-dev@netbsd.org>
From: Tero Manninen <tero.manninen@oulu.fi>
List: amiga-dev
Date: 09/23/1994 23:14:28
Hi,

I was testing some things at a friends NetBSD current machine.  While
testing I discoverd a peculiar effect when making a file link in a
directory which had sticky bit set.

Well, the making of link itself went fine, but when I tried to remove
it.. uhh, I couldn't! /bin/ln seemed to set the link uid & gid to zero
(0) and not copying them from the running environment (user). Also the
link protection bits are set to 777, not from the current umask. The
actual command was to "ln -s /bin/sh /tmp/link_test", and before that
the /tmp was set to sticky..

As you may know, the sticky bit in directories make the directory a
bit more secure in a way that anyone can create files there but only
the owner/creator can remove them. As the /bin/ln used wrong uid & gid
when creating the link, effect is that link creator can't remove it.

I verified the link operation in a Solaris 2.3 machine too, there the
/bin/ln uses user uid & gid when making link, and things work OK.

++Tero