From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 10:49:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38E5D16A4CE for ; Mon, 4 Oct 2004 10:49:55 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 865A443D49 for ; Mon, 4 Oct 2004 10:49:54 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i94AnqS4029859; Mon, 4 Oct 2004 13:49:52 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i94AnpdG004406; Mon, 4 Oct 2004 13:49:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)i94AnpR6004405; Mon, 4 Oct 2004 13:49:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Mon, 4 Oct 2004 13:49:51 +0300 From: Giorgos Keramidas To: Dmitry Karasik Message-ID: <20041004104951.GA4301@orion.daedalusnetworks.priv> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84ekke3i34.fsf@plab.ku.dk> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 10:49:55 -0000 On 2004-10-04 12:15, Dmitry Karasik wrote: > On 02 Oct 04 at 10:51, "Giorgos" (Giorgos Keramidas) wrote: > Giorgos> The reason I liked this idea is that root has zillions of other > Giorgos> ways to destroy an entire system, but not many of them are likely > Giorgos> to be the result of mistyping a single character as shown below: > > Giorgos> # rm -fr / home/someuser/* > > I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? > Write a simple wrapper around, as many sysadmins do for their needs, > and use it instead of rm. > > #!/usr/bin/perl -w > for (@ARGV) {die "$_ is a boo-boo!\n" if m/^\//} > exit system 'rm' , @ARGV; I've lost interest in making any sort of changes to rm(1) after the first dozen or so of messages like this one. Has nobody else seen the logical fallacy of keeping rm(1) unchanged "in order to avoid changes that might not be there in the next system" and suggesting a "locally customized hack like a shell/perl/whatever wrapper" as a better alternative? The shell wrapper will not be there in the next system either. Introducing local incompatibilities and hacks like a perl script wrapper of rm(1) is highly unportable. Simply switching between two different machines will bite you in more dangerous ways than the current version of rm(1) that is part of the system, once you start depending on the local hack you have in one of the machines. Why this is deemed better than something that is part of the source (tunable or not), is far beyond me. Having said that, I'm not going to post about this topic in -hackers anymore (or any other list, for that matter). The arguments against the change have not been very true, coherent or satisfactory, but the general sentiment seems to be that people want rm(1) unchanged. Unchanged it will be, then. Thanks to all who posted on the thread. I didn't intend to start a flamewar of some sort, but I did. I apologize for wasting everyone's time & bandwidth. - Giorgos