From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 18:15:02 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 36E4E16A4CE for ; Sun, 3 Oct 2004 18:15:02 +0000 (GMT) Received: from bogslab.ucdavis.edu (bogslab.ucdavis.edu [169.237.68.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09B2943D45 for ; Sun, 3 Oct 2004 18:15:02 +0000 (GMT) (envelope-from gkshenaut@ucdavis.edu) Received: from [198.137.203.49] (merlin.bogs.org [198.137.203.49]) by bogslab.ucdavis.edu (8.12.8/8.12.8) with ESMTP id i93IF0uU013752 for ; Sun, 3 Oct 2004 11:15:01 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20041003.113739.95785967.imp@bsdimp.com> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003030946.GV35869@seekingfire.com> <20041003.113739.95785967.imp@bsdimp.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <20A89EEC-1568-11D9-867A-000A9590A44E@ucdavis.edu> Content-Transfer-Encoding: 7bit From: Greg Shenaut Date: Sun, 3 Oct 2004 11:14:55 -0700 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.619) 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: Sun, 03 Oct 2004 18:15:02 -0000 The "rm -fr /" is not dreaded. What is dreaded is running that command and other equally dangerous "rm" variants by mistake. Usually, the mistake comes from not paying attention to what you are typing or where you are in the directory hierarchy (for example, "rm -rf *" is probably much more likely than "rm -rf /" and can be equally destructive if run in the wrong directory). One practical solution to this "problem" is to train people not to use the "rm" command, in favor of some other command--say, "del"--with no "recursive", "force", or other options. For example, !#/bin/sh rm -- $* would probably be close to what is needed by a /usr/bin/del command. For most users, there would be no "rm" command, just as there is currently no "dd" or "mknod" command. If someone does the research to discover rm(1), and if they make the decision to use it by default instead of "del", then there's nothing anyone can do to protect them. But if "del" is advertised as the "safer" version of "rm", and it is recommended to users that it be the default, with "rm" reserved for special, extreme cases, then I think you will get the desired result, with zero breakage of existing scripts & conventions. Greg Shenaut