rm(1) bug, possibly serious
Jan Grant
jan.grant at bristol.ac.uk
Tue Sep 25 10:11:58 PDT 2007
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.
More information about the freebsd-stable
mailing list