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

2013-11-20 Thread Eric Blake
On 11/19/2013 11:45 PM, Bernhard Voelker wrote: 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

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

2013-11-20 Thread Bernhard Voelker
On 11/20/2013 02:44 PM, Eric Blake wrote: On 11/19/2013 11:45 PM, Bernhard Voelker wrote: Maybe cannot remove directory is a bit weak - it's more like refusing to remove dot|dot-dot|root directory. Indeed, a clearer error message would be possible. What about the following? $ src/rm -r

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

2013-11-20 Thread Linda Walsh
On 20/11/2013 16:03, Bernhard Voelker wrote: $ src/rm -r src/. src/rm: refusing to remove '.' or '..' directory: skipping 'src/.' That gets back to what Bob mentioned about it being a nanny-restriction. The inevitable comment to be asked by someone is Refuse? Isn't it my

bug#15943: [PATCH] doc: enhance diagnostic when rm skips . or .. arguments

2013-11-20 Thread Linda Walsh
On 20/11/2013 15:47, Bernhard Voelker wrote: - /* If a command line argument resolves to / (and --preserve-root + /* POSIX also says: + If a command line argument resolves to / (and --preserve-root is in effect -- default) diagnose and skip it. */

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

2013-11-20 Thread Eric Blake
On 11/20/2013 05:03 PM, Bernhard Voelker wrote: On 11/20/2013 02:44 PM, Eric Blake wrote: On 11/19/2013 11:45 PM, Bernhard Voelker wrote: Maybe cannot remove directory is a bit weak - it's more like refusing to remove dot|dot-dot|root directory. Indeed, a clearer error message would be

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

2013-11-20 Thread Eric Blake
On 11/20/2013 05:48 PM, Linda Walsh wrote: I still think an ENV flag that lists the command Environment variables that modify behavior are nasty, and should generally be avoided when simpler solutions exist. In this case, I'd much rather add a long option, 'rm --no-preserve-dot', and let you

bug#15943: [PATCH] doc: enhance diagnostic when rm skips . or .. arguments

2013-11-20 Thread Eric Blake
forcemerge 15943 15926 thanks On 11/20/2013 05:54 PM, Linda Walsh wrote: On 20/11/2013 15:47, Bernhard Voelker wrote: - /* If a command line argument resolves to / (and --preserve-root + /* POSIX also says: + If a command line argument resolves to / (and No

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

2013-11-20 Thread Bernhard Voelker
On 11/21/2013 01:48 AM, Linda Walsh wrote: Isn't it my computer? How do I override such a refusal? That riddle isn't too hard, is it? ;-) POSIX (and common sense) forbids to remove something ending on .. Therefore just use the canonicalized name, e.g.: $ mkdir /tmp/xx $ cd /tmp/xx

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

2013-11-20 Thread Bernhard Voelker
On 11/21/2013 03:07 AM, Eric Blake wrote: On 11/20/2013 05:03 PM, Bernhard Voelker wrote: What about the following? $ src/rm -r src/. src/rm: refusing to remove '.' or '..' directory: skipping 'src/.' That helps. Thanks, I'll push it unless someone comes up with a better wording.