From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 22:11:19 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 80B5816A4CE for ; Sat, 2 Oct 2004 22:11:19 +0000 (GMT) Received: from cydem.org (S0106000103ce4c9c.ed.shawcable.net [68.149.254.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BC5B43D4C for ; Sat, 2 Oct 2004 22:11:19 +0000 (GMT) (envelope-from soralx@cydem.org) Received: from S01060020ed3972ba.ed.shawcable.net (S01060020ed3972ba.ed.shawcable.net [68.149.254.42]) by cydem.org (Postfix/FreeBSD) with ESMTP id C20B538DB1; Sat, 2 Oct 2004 16:11:18 -0600 (MDT) From: To: Ceri Davies , Garance A Drosihn Date: Sat, 2 Oct 2004 16:11:13 -0600 User-Agent: KMail/1.5.4 References: <20041002220035.GD2493@submonkey.net> In-Reply-To: <20041002220035.GD2493@submonkey.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410021611.13450.soralx@cydem.org> 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: Sat, 02 Oct 2004 22:11:19 -0000 > > 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. Why not to just add a flag to 'rm'? For example, `rm -rf /` or `cd; rm -rf .././` will fail, but `rm -rF /` will succeed. Timestamp: 0x415F2702 [SorAlx] http://cydem.org.ua/ ridin' VN1500-B2