Subject: Re: kern/1043: unlink(2) should not let superuser remove directories
To: John Kohl <jtk@kolvir.blrc.ma.us>
From: Giles Lean <giles@nemeton.com.au>
List: netbsd-bugs
Date: 05/12/1995 11:10:12
On Thu, 11 May 1995 16:20:07 -0700  John Kohl wrote:


> >Number:         1043
> >Category:       kern
> >Synopsis:       root can unlink directories, causing FS corruption

This is historical practice.  It is definitely dangerous, but
occasionally handy to fix filesystem corruptions.  (Which I havn't
seen on NetBSD, mind you, but hardware errors and sudden loss of
power can happen to anyone.)

If you remove this functionality then the ability for the superuser
to link directories should also go, and a filesystem debugger should
be provided.

Perl users will recognise that unlinking directories is considered
'unsafe' and you have to give the -U flag for these operations to
be enabled.  Other utilities have even more stringent restrictions.

Regards,

Giles