rm(1) bug, possibly serious
Dan Nelson
dnelson at allantgroup.com
Wed Sep 26 10:27:35 PDT 2007
In the last episode (Sep 26), Oliver Fromme said:
> Bob Johnson wrote:
> > Oliver Fromme wrote:
> > > 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 *".
>
> The expansion of "*" does not include "." or "..".
Under /bin/sh, ".*" does match "." and "..", so be careful :)
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-stable
mailing list