From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 5 03:02:52 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 860B916A818 for ; Sun, 5 Nov 2006 03:02:52 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 131A043EC2 for ; Sun, 5 Nov 2006 02:10:56 +0000 (GMT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.13.7/8.13.4) with ESMTP id kA52AgZa011404; Sat, 4 Nov 2006 18:10:42 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.13.7/8.13.4/Submit) id kA52AfcE011403; Sat, 4 Nov 2006 18:10:41 -0800 (PST) Date: Sat, 4 Nov 2006 18:10:41 -0800 (PST) From: Matthew Dillon Message-Id: <200611050210.kA52AfcE011403@apollo.backplane.com> To: Joerg Pernfuss References: <20061029222847.GA68272@marvin.astase.com> <20061030003628.42bc5f8d@loki.starkstrom.lan> <00f201c6fbb6$0c6bd150$b3db87d4@multiplay.co.uk> <20061030024358.39a12359@loki.starkstrom.lan> Cc: freebsd-hackers@freebsd.org Subject: Re: [patch] rm can have undesired side-effects X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2006 03:02:52 -0000 :... :BSD behaviour: :- OpenBSD handles hardlinks since 3.3: : -P Overwrite regular files before deleting them. Files : are overwritten three times, first with the byte pattern : 0xff, then 0x00, and then 0xff again, before they are : deleted. Files with multiple links will not be overwritten. :- NetBSD uses 0xff, 0x00 and then random data. Ignores link count :- DragonFlyBSD has the same behaviour as FreeBSD : :... :Although I am a big defender of "the user should know what he does", :the "right thing to do"[TM] would probably be to sync the behaviour :of FreeBSD's rm(1) to OpenBSD and lobby NetBSD and DragonFlyBSD to do :the same :) : : Joerg I agree. I will make this change in DragonFly right now, in fact. The -P option really needs to be consistent across environments and my take on the original design was so users could alias rm to rm -P in their .cshrc files. Clearly it cannot destroy the contents of the file in the presence of hard links when used in that context. -Matt