GNU bug report logs - #15926
RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call

Previous Next

Package: coreutils;

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

Date: Tue, 19 Nov 2013 11:58:02 UTC

Severity: normal

Tags: notabug, patch

Merged with 15943

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

Bug is archived. No further changes may be made.

Full log


Message #36 received at 15926 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Eric Blake <eblake <at> redhat.com>
Cc: 15926 <at> debbugs.gnu.org, Bob Proulx <bob <at> proulx.com>
Subject: Re: bug#15926: RFE: unlink command already uses 'unlink' call; make
 'rm' use 'remove' call
Date: Wed, 20 Nov 2013 07:45:55 +0100
On 11/20/2013 03:19 AM, Eric Blake wrote:
> Yes, the 'rm -rf .' case appears to be a regression in coreutils that is
> contrary to the behavior required by POSIX.  That is:
> 
> $ mkdir /tmp/foo /tmp/foo/sub
> $ cd /tmp/foo
> $ rm -r .
> rm: cannot remove directory: ‘.’
> $ ls
> sub
> 
> appears to be a bug in current coreutils, because it should have
> successfully called rmdir("sub") prior to failing on the attempt to
> rmdir(".").

I disagree: see at the top of:

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html

  If either of the files dot or dot-dot are specified as the basename
  portion of an operand (that is, the final pathname component) or if
  an operand resolves to the root directory, rm shall write a diagnostic
  message to standard error and do nothing more with such operands.

Maybe "cannot remove directory" is a bit weak - it's more like
"refusing to remove dot|dot-dot|root directory".

Have a nice day,
Berny




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

Previous Next


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