Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Feb 2001 06:58:06 +1000
From:      Greg Black <gjb@gbch.net>
To:        dan@langille.org
Cc:        hackers@freebsd.org
Subject:   Re: Trailing slashes and rmdir - POLA broken 
Message-ID:  <nospam-3a7c70de96011ee@maxim.gbch.net>
In-Reply-To: <200102032030.f13KUAR06325@ns1.unixathome.org>  of Sun, 04 Feb 2001 09:49:19 %2B1300
References:  <200102032030.f13KUAR06325@ns1.unixathome.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
"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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?nospam-3a7c70de96011ee>