From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 30 02:00:37 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 619BB16A49E for ; Mon, 30 Oct 2006 02:00:37 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E6AB43D5E for ; Mon, 30 Oct 2006 02:00:28 +0000 (GMT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.25]) (authenticated bits=0) by cain.gsoft.com.au (8.13.5/8.13.4) with ESMTP id k9U208YK080399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Oct 2006 12:30:08 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Mon, 30 Oct 2006 12:30:02 +1030 User-Agent: KMail/1.9.4 References: <20061029222847.GA68272@marvin.astase.com> <20061030003628.42bc5f8d@loki.starkstrom.lan> In-Reply-To: <20061030003628.42bc5f8d@loki.starkstrom.lan> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2008763.zpj0jJP4Kn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610301230.03595.doconnor@gsoft.com.au> X-Spam-Score: -3.423 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.57 on 203.31.81.10 Cc: Joerg Pernfuss 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: Mon, 30 Oct 2006 02:00:37 -0000 --nextPart2008763.zpj0jJP4Kn Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 30 October 2006 10:06, Joerg Pernfuss wrote: > > I guess that it can be fixed (in case it is not desired) by: > > - Ignoring the -P option when the link count is greater then one, or > > Silently ignoring user specified options is seldom a good way to go. > The user explicitly stated he wants to wipe the file contents. I disagree that the user really meant to wipe the file if its link count is= =20 >1. IMO having rm -P not wipe the file if its link count is >1 is a good idea. if you are deleting a tree containing a file with links then this will resu= lt=20 in the file getting wiped in the end anyway because the link count will be = 1=20 after the first link is removed. Also, -f ONLY means to ignore permissions (or rather, try to ignore them). It would be easy enough to add a diagnostic message in the -P case where th= e=20 link count is >1. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart2008763.zpj0jJP4Kn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFRVyj5ZPcIHs/zowRAg52AJ9SsQVHPsITd2uk5/MC+X4K9t6FVACcDXy4 C1HE5WvjePcKs6rSu8+7o5U= =3NXT -----END PGP SIGNATURE----- --nextPart2008763.zpj0jJP4Kn--