From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 10:15:30 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 3F6FD16A515; Mon, 4 Oct 2004 10:15:30 +0000 (GMT) Received: from plab.ku.dk (plab.ku.dk [130.225.107.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96E5243D1F; Mon, 4 Oct 2004 10:15:14 +0000 (GMT) (envelope-from dk@plab.ku.dk) Received: from plab.ku.dk (localhost [127.0.0.1]) by plab.ku.dk (Postfix) with SMTP id AA8E655518; Mon, 4 Oct 2004 12:15:12 +0200 (CEST) Received: by plab.ku.dk (Postfix, from userid 1003) id 0942E55517; Mon, 4 Oct 2004 12:15:12 +0200 (CEST) Mime-version: 1.0 Content-type: text/plain; charset="koi8-r" Content-transfer-encoding: 8bit Keywords: 2001334874 X-Comment-To: Giorgos Keramidas Sender: dk@plab.ku.dk To: Giorgos Keramidas References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> From: Dmitry Karasik In-Reply-To: Giorgos Keramidas's message of "Sat, 2 Oct 2004 11:51:43 +0300" Date: 04 Oct 2004 12:15:11 +0200 Message-ID: <84ekke3i34.fsf@plab.ku.dk> Lines: 28 X-Mailer: Gnus v5.7/Emacs 20.7 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: Mon, 04 Oct 2004 10:15:30 -0000 Hi Giorgos! On 02 Oct 04 at 10:51, "Giorgos" (Giorgos Keramidas) wrote: Giorgos> The reason I liked this idea is that root has zillions of other Giorgos> ways to destroy an entire system, but not many of them are likely Giorgos> to be the result of mistyping a single character as shown below: Giorgos> # rm -fr / home/someuser/* I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? Write a simple wrapper around, as many sysadmins do for their needs, and use it instead of rm. #!/usr/bin/perl -w for (@ARGV) {die "$_ is a boo-boo!\n" if m/^\//} exit system 'rm' , @ARGV; -- Sincerely, Dmitry Karasik --- catpipe Systems ApS *BSD solutions, consulting, development www.catpipe.net +45 7021 0050