From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:54:06 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 20D5316A4CE for ; Sat, 2 Oct 2004 08:54:06 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B16843D2F for ; Sat, 2 Oct 2004 08:54:05 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a232.otenet.gr [212.205.215.232]) i928s1Rh030764; Sat, 2 Oct 2004 11:54:03 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i928s181067268; Sat, 2 Oct 2004 11:54:01 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i928s1sN067264; Sat, 2 Oct 2004 11:54:01 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 11:54:01 +0300 From: Giorgos Keramidas To: Edwin Groothuis , freebsd-hackers@freebsd.org Message-ID: <20041002085400.GB52519@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002083336.GA10355@k7.mavetju> 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: Sat, 02 Oct 2004 08:54:06 -0000 On 2004-10-02 18:33, Edwin Groothuis wrote: > On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > > John Beck, who works for Sun, has posted an entry in his blog yesterday > > about "rm -fr /" protection, which I liked a lot: > > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > > His idea was remarkably simple, so I went ahead and wrote this patch for > > rm(1) of FreeBSD: > > I'm not so much worried about 'rm -rf /', but I'm more worried about > "rm -rf *" in my home directory. It happened once because I was too > happy switching directories before realising what I was doing in > the wrong directory. I can't do anything about that, I'm afraid. > Also, refusing to do it is not the ideal way to go, I think that > if you have two -f's specified it would do it anyway. Just my two > cents of course. My intuition tells me that there is practically no case where root would really like to rm -fr the root partition. There are other ways to clean up a disk that are much faster and less prone to accidents. But I can make it behave as it does now with a double -f option.