Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2007 17:55:18 +0100 (BST)
From:      Jan Grant <jan.grant@bristol.ac.uk>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: rm(1) bug, possibly serious
Message-ID:  <20070925175244.C21973@tribble.ilrt.bris.ac.uk>
In-Reply-To: <200709251512.l8PFCoPe006574@lurza.secnetix.de>
References:  <200709251512.l8PFCoPe006574@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Sep 2007, Oliver Fromme wrote:

> Note that the command "rm -rf ../" was entered twice.
> The first time I got an error message (and exit code 1),
> the second time it apparently succeeded.

Check the man page for rm:

   -f          Attempt to remove the files without prompting for confirma-
                 tion, regardless of the file's permissions.  If the file does
                 not exist, do not display a diagnostic message or modify the
                 exit status to reflect an error.

That's what's happening the second time through. The first time, your 
current directory is getting removed (so ../ won't refer to a real 
directory the second time around). The bug is really in rm(1)'s initial 
diagnostic message.



-- 
jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
We thought time travel was impossible. But that was now and this is then.



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