Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Feb 2001 06:46:32 +1000
From:      Greg Black <gjb@gbch.net>
To:        hackers@freebsd.org
Subject:   Trailing slashes and rmdir - POLA broken
Message-ID:  <nospam-3a7c6e285f01132@maxim.gbch.net>

next in thread | raw e-mail | index | archive | help
Observe the following:

    $ uname -rs
    FreeBSD 4.1-RELEASE
    $ ls -l
    $ mkdir foo
    $ ln -s foo bar
    $ rmdir bar
    rmdir: bar: Not a directory

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.

BSD/OS gives that silly "Is a directory" error message for the
"rmdir bar/" case, but at least it does not actually do anything.

I don't think FreeBSD should do what it does.  Is there any good
reason to preserve this behaviour?


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-3a7c6e285f01132>