From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:34:27 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 57DBE16A4CE; Sat, 2 Oct 2004 08:34:27 +0000 (GMT) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1E5443D41; Sat, 2 Oct 2004 08:34:26 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd05.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1CDfLV-0004O2-00; Sat, 02 Oct 2004 10:34:25 +0200 Received: from fw.reifenberger.com (EXLaKYZ6ge8myb9JWIZeRPp4VdcfMap9euiL54NeUE3Xa506L9JRwn@[217.232.221.224]) by fmrl05.sul.t-online.com with esmtp id 1CDfLG-1pdK3U0; Sat, 2 Oct 2004 10:34:10 +0200 Received: from localhost (mike@localhost)i928YAo8022230; Sat, 2 Oct 2004 10:34:10 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Sat, 2 Oct 2004 10:34:09 +0200 (CEST) From: Michael Reifenberger To: Giorgos Keramidas In-Reply-To: <20041002081928.GA21439@gothmog.gr> Message-ID: <20041002102918.W22102@fw.reifenberger.com> References: <20041002081928.GA21439@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: EXLaKYZ6ge8myb9JWIZeRPp4VdcfMap9euiL54NeUE3Xa506L9JRwn@t-dialin.net X-TOI-MSGID: 9c312ecb-041e-4d27-9be5-0c221ad7e32f 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:34:27 -0000 On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > Date: Sat, 2 Oct 2004 11:19:28 +0300 > From: Giorgos Keramidas > To: freebsd-hackers@freebsd.org > Subject: Protection from the dreaded "rm -fr /" > > 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: > This does only help for the obvious case of '/' but not for the './' and '../' or '../../' ... accidents. Furthermore does it prevent root from doing `rm -rf /` which is a pretty legal operation for root since he knows what he is doing. This is UNIX, not Windows. Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com