Subject: Re: bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

From: Eric Blake <[email-masked]>
Date: Tue, 04 Sep 2012 11:57:59 -0600

On 09/03/2012 10:29 AM, Linda Walsh wrote:

>> Coreutils has already implemented an exception for the root
>> directory: --no-preserve-root (whatever this would be useful
>> for except investigating what'd happen in a VM ...).
> ---
> And by doing so has violated posix, since it doesn't say that if
> a switch is present, you can override the 2nd paragraph.

Unfortunately, you are wrong on your interpretation of POSIX.  POSIX
specifically allows implementations to add extensions, such as
--no-preserve-root, and that such extensions may explicitly override the
required behavior for the application when no extensions are used.
After all, that's what extensions are for.  In other words, coreutils is
_not_ violating POSIX by adding --no-preserve-root as an extension.

>  If we
> are going to be stricly posix, it says if the arg is the root
> directory -- the util must have nothing more to do with the operand.

POSIX does indeed say that, but it applies only when you use 'rm' in a
standards-compliant invocation; the moment you add --no-preserve-root to
your invocation, you are no longer using a standards-compliant
invocation, so all bets are off as far as POSIX goes.

> 
> If you are are going to rigidly adhere to a broken standard that is
> becoming more broken and restricted over time,  you can't put in
> pet exceptions while using POSIX compat as a justification for
> not allowing other, more user friendly, options.

If you are going to continually gripe about POSIX rather than
constructively contribute towards improving it, then we have no reason
to pay attention to your gripes.  You can become a member of the Austin
Group at no monetary cost, and contribute bug reports to places where
you think the standard has got things wrong.  But griping to the
coreutils list is not the way to get POSIX fixed.

If, on the other hand, you are arguing for more long-option extensions
to coreutils, then please contribute patches rather than gripes.

-- 
Eric Blake   [email-masked]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org