From owner-freebsd-stable@FreeBSD.ORG Wed Sep 26 14:49:21 2007 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C686016A419 for ; Wed, 26 Sep 2007 14:49:21 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA3913C4A7 for ; Wed, 26 Sep 2007 14:49:20 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id l8QElush058753 for ; Wed, 26 Sep 2007 16:48:04 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l8QElua3058752; Wed, 26 Sep 2007 16:47:56 +0200 (CEST) (envelope-from olli) Date: Wed, 26 Sep 2007 16:47:56 +0200 (CEST) Message-Id: <200709261447.l8QElua3058752@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <54db43990709251838q68bdba95iefefb43029761c34@mail.gmail.com> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 26 Sep 2007 16:48:04 +0200 (CEST) Cc: Subject: Re: rm(1) bug, possibly serious X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 14:49:21 -0000 Bob Johnson wrote: > Oliver Fromme wrote: > > By the way, an additional confusion is that ".." and "../" > > are handled differently. Specifying ".." always leads to > > this message: > > > > rm: "." and ".." may not be removed > > > > and nothing is actually removed. It is confusing that > > adding a slash leads to a different error message _and_ > > removal of the contents of the parent directory. Clearly > > a POLA violation. > > Maybe. But I expect that the behavior for "rm -rf .." is there so > that things don't get REALLY astonishing when you do "rm -rf *". The expansion of "*" does not include "." or "..". (As a side note, i also think that a tool should not try to mess with shell expansion, or make assumptions about it. For example, most shells have an optional feature to ask for confirmation when the user typed "rm *" or similar. If a user wants such protection, he can enable it. There is no reason that rm(1) or other tools try to be clever about it.) > Having a different behavior for "rm -rf ../" may have been > intentional on someone's part so you can override the protection > if you really want to. If it was intentional, then there wouldn't be a misleading error message (and exit code 1). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The last good thing written in C was Franz Schubert's Symphony number 9." -- Erwin Dieterich