Subject: Re: kern/1043: unlink(2) should not let superuser remove directories
To: None <jtk@kolvir.blrc.ma.us>
From: Ted Lemon <mellon@vix.com>
List: netbsd-bugs
Date: 05/14/1995 16:18:57
> That's an argument for using fsdb, not to let root run rampant causing
> file system corruption.  Using fsdb makes it absolutely clear that
> you're intentionally doing something dangerous.  Using unlink(2) on
> directories is just the _Wrong Way_ to fix a damaged/broken filesystem!

I agree completely - surgical tools for filesystems do not belong in
the kernel.

> I'll put my money where my mouth is, and volunteer to write an fsdb
> program.  Anybody want to send me a man page/reference/description of
> the fsdb that comes with other commercial BSD derivatives?

Unfortunately, fsdb is virtually impossible to use because its
interface is essentially adb-like, and all the commands are
single-character and non-mnemonic.   If it were something one used
every day, that would be okay, but it's more like once every two years
for me, so I always have to track down a man page, which can be hard
when my root partition is hosed.

If you're going to write an fsdb replacement, I think it would be a
win to put in a more gdb- or even dbx-like interface.  It might be
worth looking at the man page for advice on what features to put in,
but that'd be about it, IMHO.

			       _MelloN_