Re: rm(1) bug, possibly serious



Torfinn Ingolfsen wrote:
Oliver Fromme wrote:

$ cd /tmp
$ mkdir -p foo/var
$ cd foo/bar
$ rm -rf ../
rm: ../: Invalid argument
$ rm -rf ../
$

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. The very same
command.

What happens if you issue a 'pwd' command after each 'rm -rf ../'?
We want to see the output.

It's /tmp/foo/bar every time.

IMHO, the only way the second rm command *should* succeed, is if it
invalidates the current working directory, thus releasing the last lock
on the directory.

Quick testing here:
[...]
Ok, I think it is a bug.

Yes, I think so, too.

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.

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd

"Perl will consistently give you what you want,
unless what you want is consistency."
-- Larry Wall
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: why>?
    ... When you hire Excel 'developers' for your own company, ... failure on the part of whoever designed the spreadsheet in question to ... were invalid. ... I've never used this particular error message, but I've used similar, ...
    (microsoft.public.excel)
  • Re: Re-installed Outlook Performs Illegal Operation
    ... > office suite - just the Outlook. ... Search "Explorer caused an invalid page fault in module unknown"; ... The Error Message "Explorer Caused an Invalid Page Fault in Module ...
    (microsoft.public.outlook.installation)
  • Re: ListView item key
    ... "Enggas" wrote in message ... :> But I have problem setting the key for every item ... :> When I run the program, it pops up an error message "Invalid Key". ...
    (microsoft.public.vb.controls)
  • Re: How do I temporarily limit values in a query field
    ... I am getting an error message: "The expression you entered has a invalid ..or! ... This is the last few lines of the 'old' sql with an attempt to limit the records to values of <500: ... works fine until I try to put limits on it value in the qryClaimDetails query. ...
    (microsoft.public.access.queries)