Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2007 21:38:30 -0400
From:      "Bob Johnson" <fbsdlists@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   Re: rm(1) bug, possibly serious
Message-ID:  <54db43990709251838q68bdba95iefefb43029761c34@mail.gmail.com>
In-Reply-To: <200709251743.l8PHhvlP012244@lurza.secnetix.de>
References:  <20070925173634.89748abe.torfinn.ingolfsen@broadpark.no> <200709251743.l8PHhvlP012244@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/25/07, Oliver Fromme <olli@lurza.secnetix.de> wrote:
> Torfinn Ingolfsen wrote:
>  > Oliver Fromme wrote:
>  >
>  > > $ cd /tmp
>  > > $ mkdir -p foo/var
>  > > $ cd foo/bar
>  > > $ rm -rf ../
>  > > rm: ../: Invalid argument
>  > > $ rm -rf ../
>  > > $
>  > >
[...]
>  > Quick testing here:
>  > [...]
>  > Ok, I think it is a bug.
>
> Yes, I think so, too.
>
> 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.

Maybe. But I expect that the behavior for "rm -rf .." is there so that
things don't get REALLY astonishing when you do "rm -rf *". Having a
different behavior for "rm -rf ../" may have been intentional on
someone's part so you can override the protection if you really want
to.

- Bob



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