[patch] rm can have undesired side-effects

Steven Hartland killing at multiplay.co.uk
Mon Oct 30 03:31:33 UTC 2006


----- Original Message ----- 
From: "Mike Meyer" <mwm at mired.org>
> Actually, rm -f either removes no copies or removes them all, because
> there's only one copy. It either gets removed (if this was the last
> link) or it doesn't. And you seem to have missed my point. Having a
> "destroy this data" option that doesn't do it based on the link count
> makes as much sense as having "rm" not remove a link based on the link
> count.

Hehe your saying that removing a file doesnt always remove the
file, thanks for making my point :D

Its clear in my mind and others it seems, that the OpenBSD method
is how this should work.

You can procrastinate all you like about "designed for adults"
that doesnt change the fact destroying the data in a file referenced
else where is not what the user would expect, adult or not.

Just like they wouldn't expect rm -f to automatically decrement
the reference count to 0 and erase the file from FS totally. This
would be the case by your argument, as reading the man page of rm
there is no mention of anything like:
"Only if the reference count reaches 0 is the file really removed
from the file system."
It only stats the following:
"The rm utility exits 0 if all of the named files or file hierarchies
were removed"

But as we all know the files may be referenced else where and hence
said files may not in fact be "removed" at all only their local
reference.

So either the docs need to be updated to make it VERY clear this
unexpected behaviour will occur or the code and the docs updated
to make it function in a more predictable manor.

    Steve


================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster at multiplay.co.uk.



More information about the freebsd-hackers mailing list