Re: rm(1) bug, possibly serious

2007-10-01 Thread Mark Andrews
On Thu, 27 Sep 2007, Mark Andrews wrote: (I wrote:) On Tue, 25 Sep 2007, LI Xin wrote: Oliver Fromme wrote: Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying ..

Re: rm(1) bug, possibly serious

2007-09-30 Thread Ian Smith
On Thu, 27 Sep 2007, Mark Andrews wrote: (I wrote:) On Tue, 25 Sep 2007, LI Xin wrote: Oliver Fromme wrote: Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always

Re: rm(1) bug, possibly serious

2007-09-26 Thread Oliver Fromme
Bob Johnson wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be removed and nothing is actually removed. It is confusing that adding a slash

Re: rm(1) bug, possibly serious

2007-09-26 Thread Ian Smith
On Tue, 25 Sep 2007, LI Xin wrote: Oliver Fromme wrote: Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be

Re: rm(1) bug, possibly serious

2007-09-26 Thread Dan Nelson
In the last episode (Sep 26), Oliver Fromme said: Bob Johnson wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be removed and nothing is

Re: rm(1) bug, possibly serious

2007-09-26 Thread Alex Zbyslaw
Dan Nelson wrote: In the last episode (Sep 26), Oliver Fromme said: Bob Johnson wrote: Maybe. But I expect that the behavior for rm -rf .. is there so that things don't get REALLY astonishing when you do rm -rf *. The expansion of * does not include . or ... Under /bin/sh, .*

Re: rm(1) bug, possibly serious

2007-09-26 Thread Oliver Fromme
Dan Nelson wrote: Oliver Fromme said: The expansion of * does not include . or ... Under /bin/sh, .* does match . and .., so be careful :) For that reason I got used to type .??* instead of .* since I started with UNIX almost 20 years ago. ;-) Apart from that, zsh is my shell of

[OT] Re: rm(1) bug, possibly serious

2007-09-26 Thread Tuomo Latto
Alex Zbyslaw wrote: .??* is a standard workaround that works most of the time. Won't match .a .b etc but such antisocial files are the exception, one might hope. What? I name all my files that way! Granted, that only allows under 30 files per directory, but so what? -- Tuomo ... SROL

Re: rm(1) bug, possibly serious

2007-09-26 Thread Bob Johnson
On 9/26/07, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Sep 26), Oliver Fromme said: Bob Johnson wrote: Maybe. But I expect that the behavior for rm -rf .. is there so that things don't get REALLY astonishing when you do rm -rf *. The expansion of * does not include .

Re: rm(1) bug, possibly serious

2007-09-26 Thread Bruce Evans
On Tue, 25 Sep 2007, LI Xin wrote: I think this is a bug, here is a fix obtained from NetBSD. This bug, if any, cannot be fixed in rm. The reasoning (from NetBSD's rm.c,v 1.16): Bugs can easily be added to rm. Strip trailing slashes of operands in checkdot(). POSIX.2 requires that if .

Re: rm(1) bug, possibly serious

2007-09-26 Thread Mark Andrews
On Tue, 25 Sep 2007, LI Xin wrote: Oliver Fromme wrote: Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not

rm(1) bug, possibly serious

2007-09-25 Thread Oliver Fromme
Hi, Today I noticed the following behaviour on a 6-stable machine: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ rm -rf ../ $ Note that the command rm -rf ../ was entered twice. The first time I got an error message (and exit code 1), the second time it

Re: rm(1) bug, possibly serious

2007-09-25 Thread Maxim Khitrov
On 9/25/07, Oliver Fromme [EMAIL PROTECTED] wrote: Hi, Today I noticed the following behaviour on a 6-stable machine: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ rm -rf ../ $ Note that the command rm -rf ../ was entered twice. The first time I

Re: rm(1) bug, possibly serious

2007-09-25 Thread Oleg Nauman
On Tue, Sep 25, 2007 at 05:12:50PM +0200, Oliver Fromme wrote: Hi, Today I noticed the following behaviour on a 6-stable machine: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar Looks like you have mistyped 'mkdir' argument :) $ rm -rf ../ rm: ../: Invalid argument Please type 'pwd'

Re: rm(1) bug, possibly serious

2007-09-25 Thread Torfinn Ingolfsen
On Tue, 25 Sep 2007 17:12:50 +0200 (CEST) Oliver Fromme [EMAIL PROTECTED] wrote: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ rm -rf ../ $ Note that the command rm -rf ../ was entered twice. The first time I got an error message (and exit code 1),

Re: rm(1) bug, possibly serious

2007-09-25 Thread Jan Grant
On Tue, 25 Sep 2007, Oliver Fromme wrote: Note that the command rm -rf ../ was entered twice. The first time I got an error message (and exit code 1), the second time it apparently succeeded. Check the man page for rm: -f Attempt to remove the files without prompting for

Re: rm(1) bug, possibly serious

2007-09-25 Thread Oliver Fromme
Torfinn Ingolfsen wrote: Oliver Fromme wrote: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ rm -rf ../ $ Note that the command rm -rf ../ was entered twice. The first time I got an error message (and exit code 1), the

Re: rm(1) bug, possibly serious

2007-09-25 Thread LI Xin
I think this is a bug, here is a fix obtained from NetBSD. The reasoning (from NetBSD's rm.c,v 1.16): Strip trailing slashes of operands in checkdot(). POSIX.2 requires that if . or .. are specified as the basename portion of an operand, a diagnostic message be written to standard error, etc.

Re: rm(1) bug, possibly serious

2007-09-25 Thread Nicolas Rachinsky
* Oliver Fromme [EMAIL PROTECTED] [2007-09-25 19:43 +0200]: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be removed and nothing is actually removed. It is confusing that adding a slash

Re: rm(1) bug, possibly serious

2007-09-25 Thread Oliver Fromme
Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be removed and nothing is actually removed. It is confusing that adding a

Re: rm(1) bug, possibly serious

2007-09-25 Thread LI Xin
Oliver Fromme wrote: Nicolas Rachinsky wrote: Oliver Fromme wrote: By the way, an additional confusion is that .. and ../ are handled differently. Specifying .. always leads to this message: rm: . and .. may not be removed and nothing is actually removed. It is

Re: rm(1) bug, possibly serious

2007-09-25 Thread Oliver Brandmueller
Hi, On Tue, Sep 25, 2007 at 11:25:34AM -0400, Maxim Khitrov wrote: On 9/25/07, Oliver Fromme [EMAIL PROTECTED] wrote: To add further confusion, another rm -rf ../ does not print an error message and seemingly succeeds, even though .. does not exist anymore in the current directory (which

Re: rm(1) bug, possibly serious

2007-09-25 Thread Patrick M. Hausen
Hello! On Tue, Sep 25, 2007 at 11:54:14PM +0200, Oliver Brandmueller wrote: In sh: $ which rm /bin/rm $ cd /tmp $ mkdir -p foo/bar $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ pwd /tmp $ ktrace -i /bin/sh $ which rm /bin/rm $ mkdir -p foo/bar $ cd foo/bar $ rm -rf ../ rm:

Re: rm(1) bug, possibly serious

2007-09-25 Thread Bob Johnson
On 9/25/07, Oliver Fromme [EMAIL PROTECTED] wrote: Torfinn Ingolfsen wrote: Oliver Fromme wrote: $ cd /tmp $ mkdir -p foo/var $ cd foo/bar $ rm -rf ../ rm: ../: Invalid argument $ rm -rf ../ $ [...] Quick testing here: [...] Ok, I think it is a bug.

Re: rm(1) bug, possibly serious

2007-09-25 Thread CmdLnKid
On Tue, 25 Sep 2007 17:55 +0100, jan.grant wrote: On Tue, 25 Sep 2007, Oliver Fromme wrote: Note that the command rm -rf ../ was entered twice. The first time I got an error message (and exit code 1), the second time it apparently succeeded. Check the man page for rm: -f Attempt