Date: Mon, 30 Oct 2006 11:41:17 +0800 From: LI Xin <delphij@delphij.net> To: Joerg Pernfuss <elessar@bsdforen.de> Cc: freebsd-hackers@freebsd.org Subject: Re: [patch] rm can have undesired side-effects Message-ID: <4545745D.5080008@delphij.net> In-Reply-To: <20061030030636.66af0924@loki.starkstrom.lan> References: <20061029222847.GA68272@marvin.astase.com> <20061030003628.42bc5f8d@loki.starkstrom.lan> <00f201c6fbb6$0c6bd150$b3db87d4@multiplay.co.uk> <20061030024358.39a12359@loki.starkstrom.lan> <20061030030636.66af0924@loki.starkstrom.lan>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Joerg Pernfuss wrote:
> On Mon, 30 Oct 2006 02:43:58 +0100
> Joerg Pernfuss <elessar@bsdforen.de> wrote:
>
>> That would mean that `rm -P <file>' with <file> having a link count of
>> at least 2, would behave like `rm <file>' (and like Romain suggested).
>
>
> Correction after some `read the frakkin code':
>
> if (sbp->st_nlink > 1) {
> warnx("%s (inode %u): not overwritten due to multiple links",
> file, sbp->st_ino);
> return (0);
> The link is removed, the file is not overwritten and a warning is generated.
Yeah I think this is reasonable and thanks y'all for mentioning this.
I have just committed a similar patch that is ported from OpenBSD
against -HEAD.
Cheers,
--
Xin LI <delphij@delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFRXRdOfuToMruuMARA9tqAJ42vUDqcWYSI4/BfnwCAHQmL40o4wCeMAsr
DQvbfYCrtQeQozok1ucHFw8=
=DUE7
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4545745D.5080008>
