rm(1) bug, possibly serious

CmdLnKid cmdlnkid at gmail.com
Tue Sep 25 21:29:49 PDT 2007


On Tue, 25 Sep 2007 17:55 +0100, jan.grant wrote:

> 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.
>

Just wanted to point out that this actually goes all the way back as far 
as 4.6.2-RELEASE-p27. I dont have any earlier machines than that to test
on but best guess is that it most likely goes back further than that.

-- 

  - (2^(N-1))



More information about the freebsd-stable mailing list