Date: Tue, 25 Sep 2007 21:04:07 +0200 From: Nicolas Rachinsky <fbsd-stable-0@ml.turing-complete.org> To: freebsd-stable@FreeBSD.ORG Subject: Re: rm(1) bug, possibly serious Message-ID: <20070925190407.GA39037@mid.pc5.i.0x5.de> 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
* Oliver Fromme <olli@lurza.secnetix.de> [2007-09-25 19:43 +0200]: > 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. Adding a slash often leads to different behaviour. nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar nicolas@pc5 ~/rd> rm -r bar nicolas@pc5 ~/rd> ls -l total 2 drwxr-xr-x 2 nicolas wheel 512 Sep 25 20:55 foo/ nicolas@pc5 ~/rd> nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar nicolas@pc5 ~/rd> rm -r bar/ nicolas@pc5 ~/rd> ls -l total 0 lrwxr-xr-x 1 nicolas wheel 3 Sep 25 20:56 bar@ -> foo nicolas@pc5 ~/rd> And cp -R behaves differently for dir and dir/, too, but it is explicitly documented there. Nicolas -- http://www.rachinsky.de/nicolas
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070925190407.GA39037>