From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 20:11:56 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 6D5DE16A4CE for ; Sat, 2 Oct 2004 20:11:56 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20E2E43D1F for ; Sat, 2 Oct 2004 20:11:56 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i92KCBQ4001743; Sat, 2 Oct 2004 16:12:11 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i92KCBcv001742; Sat, 2 Oct 2004 16:12:11 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 2 Oct 2004 16:12:11 -0400 From: David Schultz To: Michael Reifenberger Message-ID: <20041002201211.GA1677@VARK.MIT.EDU> Mail-Followup-To: Michael Reifenberger , freebsd-hackers@FreeBSD.ORG References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002185055.GA1029@VARK.MIT.EDU> <20041002211759.R24332@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002211759.R24332@fw.reifenberger.com> 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 20:11:56 -0000 On Sat, Oct 02, 2004, Michael Reifenberger wrote: > On Sat, 2 Oct 2004, David Schultz wrote: > ... > >Do you also want to be able to swap to the root partition while > >it's mounted? We can bring back that feature, too. But > >personally, I don't see anything wrong with the view that > >operations that are guaranteed to shoot people in the foot should > >be disallowed. > > > > Every anti foot shooting takes time to check for. > A strncmp for every arg is maybe ok. Traversing the tree for realpath is > not. > The job for `rm` is to remove whatever it is given to get removed. > As fast as possible. Nothing else. Sigh. The original patch that just used strcmp() wouldn't have increased the time to execute rm by more than a few hundred nanoseconds.