Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Oct 2004 10:42:16 -0500 (CDT)
From:      Sean Farley <sean-freebsd@farley.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Protection from the dreaded "rm -fr /"
Message-ID:  <20041002102430.Y5481@thor.farley.org>
In-Reply-To: <200410021123.59811.max@love2party.net>
References:  <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2 Oct 2004, Max Laier wrote:

> At very least you should consider to error out silently as POSIX
> requires "-f" to be silent. Other than that you should really look
> into the standards and what they way about rm and friends.

Personally, I would want it to throw an error for the exit, but I do not
know the standard.

> I am not a fan of providing seat belts like this. People concerned
> about this, can "alias rm 'rm -i'" etc. etc.  Others have commented
> like this ...

Seat belts that prevent a destructive action that may be desired only
.0000001% (or much less) of the time do not bother me especially when
the action is from a common tool.  If the tool was rarely used (i.e.,
fdisk), or the action was desired much more often, then I could see a
complaint about it.

I already have that alias; -f overrides -i.  It would drive me crazy for
it to not override -i.  Solaris does not allow -f to override -i and
will ask for everything you want to delete recursively.  I had to always
type '/bin/rm -rf <dir>' to go around this.  Highly annoying.

> If you still have to make this change, make it tuneable with a
> environment variable (and make it default to off).

Why not default on?  root will not run 'rm -rf /' on purpose very often.
Once will be enough.  :)  Also, when and why would someone want to do
this?

Sean
-----------------------
sean-freebsd@farley.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041002102430.Y5481>