From owner-freebsd-hackers Sat Feb 3 12:58:43 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gw.gbch.net (gw.gbch.net [203.24.22.66]) by hub.freebsd.org (Postfix) with SMTP id CAEED37B6AF for ; Sat, 3 Feb 2001 12:58:09 -0800 (PST) Received: (qmail 4632 invoked by uid 1001); 4 Feb 2001 06:58:06 +1000 X-Posted-By: GJB-Post 2.11 18-Jan-2001 X-Operating-System: FreeBSD 4.1-RELEASE i386 X-URL: http://www.gbch.net/gjb/ X-Image-URL: http://www.gbch.net/gjb/img/gjb-auug048.gif X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 X-PGP-Public-Key: http://www.gbch.net/gjb/gjb-pgpkey.asc Message-Id: Date: Sun, 04 Feb 2001 06:58:06 +1000 From: Greg Black To: dan@langille.org Cc: hackers@freebsd.org Subject: Re: Trailing slashes and rmdir - POLA broken References: <200102032030.f13KUAR06325@ns1.unixathome.org> In-reply-to: <200102032030.f13KUAR06325@ns1.unixathome.org> of Sun, 04 Feb 2001 09:49:19 +1300 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Dan Langille" wrote: > On 4 Feb 2001, at 6:46, Greg Black wrote: > > > Observe the following: > > > > $ uname -rs > > FreeBSD 4.1-RELEASE > > $ ls -l > > $ mkdir foo > > $ ln -s foo bar > > $ rmdir bar > > rmdir: bar: Not a directory > > I'm quite sure that rm bar will work. Of course it works. The part you quoted was the introduction and was as it "should" be. You cut out the part with the actual question. I'll repeat it here: So far, so good -- but look at this: $ rmdir bar/ $ ls -l total 0 lrwxrwx--- 1 gjb wheel 3 Feb 4 06:35 bar -> foo $ Oops, "rmdir bar/" ended up as "rmdir foo" and left the useless symlink bar in place. What I'm saying is that the ls above should have shown the directory foo, because "rmdir bar/" should not result in doing the same as "rmdir foo". IMO, "rmdir bar/" should elicit the same response as "rmdir bar" -- "Not a directory" and no action. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message