From owner-freebsd-questions@freebsd.org Sun Apr 17 17:36:21 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 257BDB10884 for ; Sun, 17 Apr 2016 17:36:21 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA9C7182F for ; Sun, 17 Apr 2016 17:36:19 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-71-243.dynamic.qsc.de [92.195.71.243]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 2D51A24D92; Sun, 17 Apr 2016 19:36:10 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u3HHaAjm003505; Sun, 17 Apr 2016 19:36:10 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 17 Apr 2016 19:36:10 +0200 From: Polytropon To: Odhiambo Washington Cc: User Questions Subject: Re: rm -rf -Mitigating the dangers Message-Id: <20160417193610.b5437205.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 17:36:21 -0000 On Sun, 17 Apr 2016 20:10:11 +0300, Odhiambo Washington wrote: > With great power comes great responsibility and as such I think there > should be a wrapper around rm to warn sysadmins that what they are about to > do with -rf is dangerous, yes? If you see that the command line contains -f, "force", then you should already know what you're doing, as you're _intendedly_ avoiding any safety belts. A person _responsible_ for a system who starts entering the "rm" command line should know what he's doing, especially when operating in an environment where the command line is being used (instead of a TUI or GUI file manager that makes it less easier to do something stupid). But no matter what you do, there simply is no universal protection against fat fingers, lazy eyes, and tired brain cells. I know what I'm talking about. ;-) > Read input from sysadmin 3 times, looking strictly for their confirmation > before effecting the `rm -rf`. Lazy sysadmins annoyed by this security measure will write a wrapper around it, call it "rm", and make sure the command line arguments are provided three times identically. Problem solved. :-) A nice idea is to use "echo" instead of "rm" first, and check the output, if that is _really_ what you want to delete, and then, and _only then_, replace "echo" with "rm". > Could it be that what I am smoking/drinking is the issue here or I have > your support? LOL Is this because of the recent "rm -rf hoax"? http://serverfault.com/questions/587102/monday-morning-mistake-sudo-rm-rf-no-preserve-root http://meta.serverfault.com/questions/8696/what-to-do-with-the-rm-rf-hoax-question Because people love car analogies... we don't have spikes in the streets infront of traffic lights that empty the tires of a driver who wants to surpass the red light, and forcing him to exchange the tires when he _insists_ on crossing the red light doesn't make the idea any better. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...