From owner-freebsd-stable@FreeBSD.ORG Tue Sep 25 19:20:54 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 62CA416A419 for ; Tue, 25 Sep 2007 19:20:54 +0000 (UTC) (envelope-from nicolas@i.0x5.de) Received: from n.0x5.de (n.0x5.de [217.197.85.144]) by mx1.freebsd.org (Postfix) with ESMTP id DE66E13C45B for ; Tue, 25 Sep 2007 19:20:53 +0000 (UTC) (envelope-from nicolas@i.0x5.de) Received: by pc5.i.0x5.de (Postfix, from userid 1003) id 7EAD361C71; Tue, 25 Sep 2007 21:04:07 +0200 (CEST) Date: Tue, 25 Sep 2007 21:04:07 +0200 From: Nicolas Rachinsky To: freebsd-stable@FreeBSD.ORG Message-ID: <20070925190407.GA39037@mid.pc5.i.0x5.de> Mail-Followup-To: freebsd-stable@FreeBSD.ORG References: <20070925173634.89748abe.torfinn.ingolfsen@broadpark.no> <200709251743.l8PHhvlP012244@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200709251743.l8PHhvlP012244@lurza.secnetix.de> X-Powered-by: FreeBSD X-Homepage: http://www.rachinsky.de X-PGP-Keyid: 887BAE72 X-PGP-Fingerprint: 039E 9433 115F BC5F F88D 4524 5092 45C4 887B AE72 X-PGP-Keys: http://www.rachinsky.de/nicolas/gpg/nicolas_rachinsky.asc User-Agent: Mutt/1.5.15 (2007-04-06) 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: Tue, 25 Sep 2007 19:20:54 -0000 * Oliver Fromme [2007-09-25 19:43 +0200]: > 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. Adding a slash often leads to different behaviour. nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar nicolas@pc5 ~/rd> rm -r bar nicolas@pc5 ~/rd> ls -l total 2 drwxr-xr-x 2 nicolas wheel 512 Sep 25 20:55 foo/ nicolas@pc5 ~/rd> nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar nicolas@pc5 ~/rd> rm -r bar/ nicolas@pc5 ~/rd> ls -l total 0 lrwxr-xr-x 1 nicolas wheel 3 Sep 25 20:56 bar@ -> foo nicolas@pc5 ~/rd> And cp -R behaves differently for dir and dir/, too, but it is explicitly documented there. Nicolas -- http://www.rachinsky.de/nicolas