From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 15:37:08 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 0F11816A4CE; Tue, 5 Oct 2004 15:37:08 +0000 (GMT) Received: from mail.wolves.k12.mo.us (duey.wolves.k12.mo.us [207.160.214.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABC7043D2D; Tue, 5 Oct 2004 15:37:07 +0000 (GMT) (envelope-from cdillon@wolves.k12.mo.us) Received: from localhost (localhost [127.0.0.1]) by mail.wolves.k12.mo.us (Postfix) with ESMTP id EC9DF1FE25; Tue, 5 Oct 2004 10:37:06 -0500 (CDT) Received: from mail.wolves.k12.mo.us ([127.0.0.1]) by localhost (mail.wolves.k12.mo.us [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 46112-01-37; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Received: by mail.wolves.k12.mo.us (Postfix, from userid 1001) id E9D9B1FE22; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.wolves.k12.mo.us (Postfix) with ESMTP id E79721A904; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Date: Tue, 5 Oct 2004 10:37:04 -0500 (CDT) From: Chris Dillon To: Greg Black In-Reply-To: Message-ID: <20041005103123.C46325@duey.wolves.k12.mo.us> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002083336.GA10355@k7.mavetju> <20041002101842.GA23272@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at wolves.k12.mo.us cc: Max Laier cc: Ryan Sommers cc: Giorgos Keramidas 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: Tue, 05 Oct 2004 15:37:08 -0000 On Sat, 2 Oct 2004, Greg Black wrote: > As for protecting against "rm -rf / foo" as a typo for "rm -rf > /foo", I don't mind if we offer protection against that; but I see > no reason at all to "protect" root from "rm -rf /". It's fair to > say that somebody who types that means it, and it's fair to go as > far as we can in satisfying it. I think you just nailed it on the head right here... if you say "rm -rf /" you probably mean it, but if you say "rm -rf / foo" you probably oopsed (pretty good bet, since rm / makes asking to rm foo redundant). How about checking if there is more than one argument, and if one of those arguments is "/", fail. If there is only one argument, even if it is "/", assume the user knows what he is doing and proceed normally. -- Chris Dillon - cdillon(at)wolves.k12.mo.us FreeBSD: The fastest, most open, and most stable OS on the planet - Available for IA32, IA64, AMD64, PC98, Alpha, and UltraSPARC architectures - PowerPC, ARM, MIPS, and S/390 under development - http://www.freebsd.org Q: Because it reverses the logical flow of conversation. A: Why is putting a reply at the top of the message frowned upon?