From owner-freebsd-stable@FreeBSD.ORG Tue Sep 25 16:36:37 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 607B716A419 for ; Tue, 25 Sep 2007 16:36:37 +0000 (UTC) (envelope-from torfinn.ingolfsen@broadpark.no) Received: from osl1smout1.broadpark.no (osl1smout1.broadpark.no [80.202.4.58]) by mx1.freebsd.org (Postfix) with ESMTP id 09A8813C447 for ; Tue, 25 Sep 2007 16:36:36 +0000 (UTC) (envelope-from torfinn.ingolfsen@broadpark.no) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII Received: from osl1sminn1.broadpark.no ([80.202.4.59]) by osl1smout1.broadpark.no (Sun Java(tm) System Messaging Server 6.3-3.01 (built Jul 12 2007; 32bit)) with ESMTP id <0JOX00F87KOZMJB0@osl1smout1.broadpark.no> for freebsd-stable@freebsd.org; Tue, 25 Sep 2007 17:36:35 +0200 (CEST) Received: from kg-work.kg4.no ([80.202.72.202]) by osl1sminn1.broadpark.no (Sun Java(tm) System Messaging Server 6.3-3.01 (built Jul 12 2007; 32bit)) with SMTP id <0JOX00B2BKOYR1H0@osl1sminn1.broadpark.no> for freebsd-stable@freebsd.org; Tue, 25 Sep 2007 17:36:35 +0200 (CEST) Date: Tue, 25 Sep 2007 17:36:34 +0200 From: Torfinn Ingolfsen To: freebsd-stable@freebsd.org Message-id: <20070925173634.89748abe.torfinn.ingolfsen@broadpark.no> In-reply-to: <200709251512.l8PFCoPe006574@lurza.secnetix.de> References: <200709251512.l8PFCoPe006574@lurza.secnetix.de> X-Mailer: Sylpheed 2.4.6 (GTK+ 2.10.14; i386-portbld-freebsd6.2) X-Face: "t9w2,-X@O^I`jVW\sonI3.,36KBLZE*AL[y9lL[PyFD*r_S:dIL9c[8Y>V42R0"!"yb_zN,f#%.[PYYNq; m"_0v; ~rUM2Yy!zmkh)3&U|u!=T(zyv,MHJv"nDH>OJ`t(@mil461d_B'Uo|'nMwlKe0Mv=kvV?Nh@>Hb<3s_z2jYgZhPb@?Wi^x1a~Hplz1.zH 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: Tue, 25 Sep 2007 16:36:37 -0000 On Tue, 25 Sep 2007 17:12:50 +0200 (CEST) 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. 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: tingo@kg-work$ mkdir -p foo/bar tingo@kg-work$ cd foo/bar tingo@kg-work$ ll total 4 drwxr-xr-x 2 tingo wheel - 512 Sep 25 17:31 ./ drwxr-xr-x 3 tingo wheel - 512 Sep 25 17:31 ../ tingo@kg-work$ pwd /tmp/foo/bar tingo@kg-work$ rm -rf ../ rm: ../: Invalid argument tingo@kg-work$ pwd /tmp/foo/bar tingo@kg-work$ rm -rf ../ tingo@kg-work$ pwd /tmp/foo/bar tingo@kg-work$ ls -al total 0 tingo@kg-work$ ll total 0 tingo@kg-work$ pwd /tmp/foo/bar tingo@kg-work$ ls -al .. ls: ..: No such file or directory tingo@kg-work$ ls -al /tmp/foo/bar ls: /tmp/foo/bar: No such file or directory tingo@kg-work$ ls -al /tmp/foo total 8 drwxr-xr-x 2 tingo wheel 512 Sep 25 17:32 . drwxrwxrwt 35 root wheel 5632 Sep 25 17:31 .. Ok, I think it is a bug. -- Regards, Torfinn Ingolfsen