Date: Sat, 2 Oct 2004 11:46:07 -0500 From: "Jacques A. Vidrine" <nectar@FreeBSD.org> To: Peter Jeremy <PeterJeremy@optushome.com.au> Cc: Giorgos Keramidas <keramida@freebsd.org> Subject: Re: Protection from the dreaded "rm -fr /" Message-ID: <20041002164607.GD90985@madman.celabo.org> In-Reply-To: <20041002124349.GA21569@cirb503493.alcatel.com.au> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <20041002124349.GA21569@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 02, 2004 at 10:43:49PM +1000, Peter Jeremy wrote:
> I've had a customer write a cronjob that did almost exactly this.
> He managed to 'test' it on all the (redundant) production systems
> as well as the test model. We were only called in when he found
> that there were some unexpected console messages and the systems
> wouldn't boot when he pressed the reset button. Luckily it
> managed to kill itself before it destroyed all the evidence (since
> the culprit initially denied doing anything).
>
> Based on that, I'm definitely in favour of some anti-foot-shooting
> measures.
[...]
FWIW, I'm not in favor of adding ad-hoc "features" to handle edge-cases.
("feature" because this is actually introducing a bug :-)
I picked this email to which to respond, because I can share my own
stupidity. Case much like the one described above, but my cronjob
included something like:
cd /path/to/directory/with/temporary/files
rm -fr *
Only another admin removed
`/path/to/directory/with/temporary/files'... so the `cd' failed
and left the current directory as `/'. For some reason the system
crashed :-) ... and then crashed again a few days after restoring
from backup... doh!
Will the next step be to prevent `rm -fr *' iff the current working
directory is '/' ? Please explain your answer. :-)
Cheers,
--
Jacques A Vidrine / NTT/Verio
nectar@celabo.org / jvidrine@verio.net / nectar@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041002164607.GD90985>
