From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:33:40 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 80DFB16A4CE; Sat, 2 Oct 2004 08:33:40 +0000 (GMT) Received: from mailout2.barnet.com.au (mailout2.barnet.com.au [218.185.88.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAF7743D1F; Sat, 2 Oct 2004 08:33:39 +0000 (GMT) (envelope-from edwin@mavetju.org) Received: by mailout2.barnet.com.au (Postfix, from userid 27) id 39B0D70744D; Sat, 2 Oct 2004 18:33:38 +1000 (EST) X-Viruscan-Id: <415E67E2000112B89F9A8C@BarNet> Received: from mail2-auth.barnet.com.au (mailout2.barnet.com.au [218.185.88.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Authority" (verified OK)) by mail2.barnet.com.au (Postfix) with ESMTP id EA82070744C; Sat, 2 Oct 2004 18:33:37 +1000 (EST) Received: from k7.mavetju (edwin-3.int.barnet.com.au [10.10.12.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Certificate Authority" (verified OK)) by mail2-auth.barnet.com.au (Postfix) with ESMTP id 64779707448; Sat, 2 Oct 2004 18:33:37 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 2A6366225; Sat, 2 Oct 2004 18:33:36 +1000 (EST) Date: Sat, 2 Oct 2004 18:33:36 +1000 From: Edwin Groothuis To: Giorgos Keramidas Message-ID: <20041002083336.GA10355@k7.mavetju> Mail-Followup-To: Edwin Groothuis , Giorgos Keramidas , freebsd-hackers@FreeBSD.org References: <20041002081928.GA21439@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002081928.GA21439@gothmog.gr> User-Agent: Mutt/1.5.6i 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: Sat, 02 Oct 2004 08:33:40 -0000 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. 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. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/