From owner-freebsd-stable@FreeBSD.ORG Tue Sep 25 21:54:16 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 76DB316A417 for ; Tue, 25 Sep 2007 21:54:16 +0000 (UTC) (envelope-from ob@gruft.de) Received: from obh.snafu.de (v6.gruft.de [IPv6:2001:1560:2342::2]) by mx1.freebsd.org (Postfix) with ESMTP id F28CE13C467 for ; Tue, 25 Sep 2007 21:54:15 +0000 (UTC) (envelope-from ob@gruft.de) Received: from ob by obh.snafu.de with local (Exim 4.68 (FreeBSD)) (envelope-from ) id 1IaIMA-000Mve-9S for freebsd-stable@freebsd.org; Tue, 25 Sep 2007 23:54:14 +0200 Date: Tue, 25 Sep 2007 23:54:14 +0200 From: Oliver Brandmueller To: freebsd-stable@freebsd.org Message-ID: <20070925215414.GQ23625@e-Gitt.NET> Mail-Followup-To: freebsd-stable@freebsd.org References: <200709251512.l8PFCoPe006574@lurza.secnetix.de> <26ddd1750709250825j2d70798awa96cd0d2d305e0a9@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: <26ddd1750709250825j2d70798awa96cd0d2d305e0a9@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: Oliver Brandmueller 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 21:54:16 -0000 --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Sep 25, 2007 at 11:25:34AM -0400, Maxim Khitrov wrote: > On 9/25/07, Oliver Fromme wrote: > > To add further confusion, another "rm -rf ../" does > > not print an error message and seemingly succeeds, > > even though ".." does not exist anymore in the current > > directory (which has been removed). >=20 > Confirmed on CURRENT as well. Note that if you run rf -rf .. as the > first command, the command does fail with 'rm: "." and ".." may not be > removed'. Adding a / at the end does seem to get around this check. May I add some more confusion? In tcsh: (23:49) ob@nowhere:ttyp2 [~] which rm /bin/rm (23:49) ob@nowhere:ttyp2 [~] cd /tmp (23:49) ob@nowhere:ttyp2 [/tmp] mkdir -p foo/bar (23:49) ob@nowhere:ttyp2 [/tmp] cd foo/bar (23:49) ob@nowhere:ttyp2 [foo/bar] rm -rf ../ (23:49) ob@nowhere:ttyp2 [foo/bar] pwd pwd: .: No such file or directory (23:52) ob@nowhere:ttyp2 [foo/bar] cd /tmp (23:52) ob@nowhere:ttyp2 [/tmp] ls (23:52) ob@nowhere:ttyp2 [/tmp]=20 In sh: $ which rm /bin/rm $ cd /tmp $ mkdir -p foo/bar $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ pwd /tmp/foo/bar $ rm -rf ../ $ pwd /tmp/foo/bar $ cd /tmp $ ls foo $ cd foo $ ls (23:53) ob@nowhere:ttyp2 [~] uname -a FreeBSD nowhere.ob-home.lan 6.2-STABLE FreeBSD 6.2-STABLE #17: Sun Aug 5 1= 9:03:13 CEST 2007 root@nowhere.ob-home.lan:/usr/obj/usr/src/sys/NOWHERE= i386 - Olli --=20 | Oliver Brandmueller | Offenbacher Str. 1 | Germany D-14197 Berlin | | Fon +49-172-3130856 | Fax +49-172-3145027 | WWW: http://the.addict.de/ | | Ich bin das Internet. Sowahr ich Gott helfe. | | Eine gewerbliche Nutzung aller enthaltenen Adressen ist nicht gestattet! | --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFG+YOGiqtMdzjafykRArgaAJ4qw2WOfoW2zCzJlE3+S4gdjYbIYwCeLKqi uFmhjTml+SX6X65zaayg8RQ= =z1Bv -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS--