From owner-freebsd-stable@FreeBSD.ORG Tue Sep 25 17:45:27 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 6396B16A418 for ; Tue, 25 Sep 2007 17:45:27 +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 735DB13C465 for ; Tue, 25 Sep 2007 17:45:26 +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 l8PHhvkQ012245; Tue, 25 Sep 2007 19:44:07 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l8PHhvlP012244; Tue, 25 Sep 2007 19:43:57 +0200 (CEST) (envelope-from olli) Date: Tue, 25 Sep 2007 19:43:57 +0200 (CEST) Message-Id: <200709251743.l8PHhvlP012244@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, torfinn.ingolfsen@broadpark.no In-Reply-To: <20070925173634.89748abe.torfinn.ingolfsen@broadpark.no> 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]); Tue, 25 Sep 2007 19:44:08 +0200 (CEST) Cc: Subject: Re: rm(1) bug, possibly serious X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, torfinn.ingolfsen@broadpark.no List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 17:45:27 -0000 Torfinn Ingolfsen wrote: > Oliver Fromme wrote: > > > $ cd /tmp > > $ mkdir -p foo/var > > $ cd foo/bar > > $ rm -rf ../ > > rm: ../: Invalid argument > > $ rm -rf ../ > > $ > > > > Note that the command "rm -rf ../" was entered twice. > > The first time I got an error message (and exit code 1), > > the second time it apparently succeeded. The very same > > command. > > What happens if you issue a 'pwd' command after each 'rm -rf ../'? > We want to see the output. It's /tmp/foo/bar every time. > IMHO, the only way the second rm command *should* succeed, is if it > invalidates the current working directory, thus releasing the last lock > on the directory. > > Quick testing here: > [...] > Ok, I think it is a bug. Yes, I think so, too. 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. 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 "Perl will consistently give you what you want, unless what you want is consistency." -- Larry Wall