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

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Mon, 3 Sep 2012 00:34:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 12339 <at> debbugs.gnu.org
Subject: bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.
Date: Tue, 04 Sep 2012 11:57:59 -0600
[Message part 1 (text/plain, inline)]
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   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.