NetBSD Problem Report #11103
Received: (qmail 21876 invoked from network); 30 Sep 2000 15:52:57 -0000
Message-Id: <200009301552.IAA28466@garbled.net>
Date: Sat, 30 Sep 2000 08:52:21 -0700 (MST)
From: Charlie Root <root@garbled.net>
Reply-To: root@garbled.net
To: gnats-bugs@gnats.netbsd.org
Subject: userdel will gleefully delete anything with -r
X-Send-Pr-Version: 3.95
>Number: 11103
>Category: bin
>Synopsis: userdel will gleefully delete anything with -r
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: simonb
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 30 15:53:00 +0000 2000
>Closed-Date: Wed Mar 07 22:15:10 +0000 2001
>Last-Modified: Wed Mar 07 22:15:10 +0000 2001
>Originator: Tim Rightnour
>Release: 1.5ALPHA2<NetBSD-current source date>
>Organization:
>Environment:
System: NetBSD polaris 1.3.2 NetBSD 1.3.2 (POLARIS) #1: Fri Nov 6 07:41:34 MST 1998 root@:/usr/src/sys/arch/i386/compile/POLARIS i386
>Description:
Userdel will gleefully wipe out any directory handed to it, recursively, when
used with the -r option. Including such favorites as /, and /root. While
we do "supply the rope", in this case, perhaps we supply a bit too much rope.
>How-To-Repeat:
code inspection, or.. delete toor with -r..
>Fix:
It should run some basic checks:
1) directory should be two components, the first not being /usr or /var, and
the second being the username.
2) it should su to the user before deleting the directory, and check the
ownership of the directory.
3) it should refuse to delete user's homedirs whose UID is 0.
While these checks are imperfect.. they are far better then some poor
unsuspecting newbie blasting /root on a machine deleting toor. In these cases
the user shuold be deleted, and a message like:
User's home directory possibly unsafe. Please check and manually remove.
should be printed. In the very least.. it should never, ever, remove /, or
/root. Perhaps it should even do a -xdev on the rm.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->simonb
Responsible-Changed-By: simonb
Responsible-Changed-When: Sat Sep 30 08:57:12 PDT 2000
Responsible-Changed-Why:
I'll take care of this one.
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
To: Charlie Root <root@garbled.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/11103: userdel will gleefully delete anything with -r
Date: Sat, 30 Sep 2000 18:26:51 +0200 (MET DST)
On Sat, 30 Sep 2000, Charlie Root wrote:
> 1) directory should be two components, the first not being /usr or /var, and
> the second being the username.
That's two restrictions here, of which the second sounds a bit hard to me.
- Hubert
--
Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Alistair Crooks <AlistairCrooks@excite.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/11103
Date: Tue, 3 Oct 2000 07:54:23 -0700 (PDT)
I'm not sure what restrictions should be placed on this.
Perhaps we should just honour the -r flag if the uid of the user being
deleted equals that of the specified home directory, and a warning displayed
otherwise (with no directory removal)?
We should also look to see what Solaris and other System V variants do -
that's the standard to which this utility was written.
Regards,
Alistair
--
Alistair Crooks (agc@pkgsrc.org)
_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html
State-Changed-From-To: open->feedback
State-Changed-By: simonb
State-Changed-When: Mon Oct 16 22:50:29 PDT 2000
State-Changed-Why:
After some discussion I've relaxed the suggested checks a little.
Tim - happy to close the PR with these changes?
State-Changed-From-To: feedback->closed
State-Changed-By: garbled
State-Changed-When: Wed Mar 7 14:14:53 PST 2001
State-Changed-Why:
I'm happy.
Tim
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.