From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 22:00:40 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 C300016A50E; Sat, 2 Oct 2004 22:00:40 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 791C143D1D; Sat, 2 Oct 2004 22:00:37 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CDrvg-000K0g-0H; Sat, 02 Oct 2004 23:00:36 +0100 Date: Sat, 2 Oct 2004 23:00:35 +0100 From: Ceri Davies To: Garance A Drosihn Message-ID: <20041002220035.GD2493@submonkey.net> Mail-Followup-To: Ceri Davies , Garance A Drosihn , Giorgos Keramidas , Lee Harr , freebsd-hackers@freebsd.org References: <20041002175704.GB2230@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OMnfC9oq5hdMsh0V" Content-Disposition: inline In-Reply-To: X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: freebsd-hackers@freebsd.org cc: Lee Harr cc: Giorgos Keramidas 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: Sat, 02 Oct 2004 22:00:40 -0000 --OMnfC9oq5hdMsh0V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 02, 2004 at 05:22:50PM -0400, Garance A Drosihn wrote: > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > >On 2004-10-02 21:23, Lee Harr wrote: > > > > John Beck, who works for Sun, has posted an entry in his blog > > > > yesterday about "rm -fr /" protection, which I liked a lot: > > > > > > > > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > >> > > > > > His idea was remarkably simple, so I went ahead and wrote this > > > > patch for rm(1) of FreeBSD: > > > > >> How about: > >> > >> chflags sunlnk / > >> ? > > > >Setting sunlink on / will only protect the / directory, not its > >descendants, so you don't gain much. >=20 > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > command will always have to stat() the file it is given (just to > see if it is a directory), so it could check to see if this flag > is turned on. If it is turned on, then 'rm' could refuse to honor > any '-rf' request on that directory. I love the idea of this; it's the most elegant solution offered yet. I'm also looking forward to the forthcoming bikeshed regarding exactly what the flag should be called. ;-) Ceri --=20 It is not tinfoil, it is my new skin. I am a robot. --OMnfC9oq5hdMsh0V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXyUDocfcwTS3JF8RAnBtAJ9DurokB5+yyohTOh2Wf+E/2qTUbwCcD1le sHabZE2tUKfIiPaIhHolZAU= =/IFq -----END PGP SIGNATURE----- --OMnfC9oq5hdMsh0V--