From owner-freebsd-questions Fri Jan 31 12:14:21 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72FF637B401 for ; Fri, 31 Jan 2003 12:14:20 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADF3E43E4A for ; Fri, 31 Jan 2003 12:14:15 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a170.otenet.gr [212.205.215.170]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h0VKE0Vq004443; Fri, 31 Jan 2003 22:14:01 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h0VKDx4l025522; Fri, 31 Jan 2003 22:13:59 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h0VKDvs6025521; Fri, 31 Jan 2003 22:13:57 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 31 Jan 2003 22:13:57 +0200 From: Giorgos Keramidas To: bastill@adam.com.au Cc: Lowell Gilbert , freebsd-questions@FreeBSD.ORG Subject: Re: Ooops. Message-ID: <20030131201357.GA18381@gothmog.gr> References: <005601c2c8c5$47735b10$6501a8c0@grant> <1043981504.3e39e4c0b6e66@webmail.adam.com.au> <44znpinhl7.fsf@be-well.ilk.org> <1043983614.3e39ecfecd509@webmail.adam.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1043983614.3e39ecfecd509@webmail.adam.com.au> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-01-31 13:56, bastill@adam.com.au wrote: > Quoting Lowell Gilbert : > > bastill@adam.com.au writes: > > Can you explain what you think is a problem? > > Well - it's happened to two uf us in the past month! In both cases > the operator was copying files from one drive to another and wished > to delete files from the second drive on which the copy resided. > In both cases rm -rf removed both copy AND source! :-( You should keep a log of the commands (if possible) when things like this happen. It was probably caused by trying to `rm -fr .*' which will match all the .dotfiles in the current directory, but will also match `..', the hard link to the parent directory. This is a very easy way to delete recursively everything on the current installation when it happens in /home or /usr or other filesystems directly mounted under /, the root filesystem. > Unfortunately, rm -rf home removed home from the source /usr > directory as well! :-( I presume that this was due to /home being > a symlink to /usr/home, and somehow that link remained, so that -r > referred to everything below the symlink as well as to the directory > I was trying to remove. > > Whatever the explanation, IMHO rm -r should NOT do this by default. As far as I know, it doesn't. You should show use a minimal set of commands that reproduces the bug. This will help anyone with a bit of C knowledge to track it down in the rm(1) source and fix it. - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message