From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 23:28:49 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 2466616A4CE for ; Sat, 2 Oct 2004 23:28:49 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35F5143D31 for ; Sat, 2 Oct 2004 23:28:48 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b221.otenet.gr [212.205.244.229]) i92NSjcD005779; Sun, 3 Oct 2004 02:28:46 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92NSe8T001816; Sun, 3 Oct 2004 02:28:43 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92N2Q0i001515; Sun, 3 Oct 2004 02:02:26 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sun, 3 Oct 2004 02:02:26 +0300 From: Giorgos Keramidas To: Garance A Drosihn Message-ID: <20041002230226.GC1381@gothmog.gr> References: <20041002175704.GB2230@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-hackers@freebsd.org cc: Lee Harr 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 23:28:49 -0000 On 2004-10-02 17:22, Garance A Drosihn wrote: > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > >On 2004-10-02 21:23, Lee Harr wrote: > >> How about: > >> chflags sunlnk / > >> ? > > > >Setting sunlink on / will only protect the / directory, not its > >descendants, so you don't gain much. > > 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. [...] Hmmm. This sounds much better indeed :-)