From owner-freebsd-hackers Mon Nov 27 10:35:32 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id KAA18643 for hackers-outgoing; Mon, 27 Nov 1995 10:35:32 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id KAA18637 for ; Mon, 27 Nov 1995 10:35:26 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id FAA20667; Tue, 28 Nov 1995 05:30:08 +1100 Date: Tue, 28 Nov 1995 05:30:08 +1100 From: Bruce Evans Message-Id: <199511271830.FAA20667@godzilla.zeta.org.au> To: freebsd-hackers@freebsd.org, peter@haywire.dialix.com Subject: Re: How can I remove hard links between directories? Sender: owner-hackers@freebsd.org Precedence: bulk >Otherwise, we get bogons like netscape2 doing 'rename(".netscape/", >".netscape.bak");' or something bogus like that, and the namei() >lookup is or was converting ".netscape/" to mean ".netscape/." and was Lookup now converts "foo/" to "foo" if foo is a directory and fails otherwise. >pulling "." out of the .netscape directory in root's home (assuming >somebody was insane enough to run netscape as root.. :-) >or some bogon inside "rdistd" running as root, renaming the "." files >if you gave it a bogus distfile.. Renaming of "." and ".." has always been disallowed in FreeBSD. It isn't possible to create a damaged tree using rename() (modulo bugs). Renaming directories "by hand" using link() and unlink() is of course dangerous. >or things like inn's fastrm program that have to test if the euid == >0, and if so, it has to stat() every single file it's processing to >make sure it's not about to unlink a directory and running much slower >from the extra overhead.. (side note, always expire news as uid >"news" for this very reason). Why would it be much slower? unlink() is very slow if writes are synchronous. Here repeated stats of the same file take 81 usec while creat+close+unlink of the same file takes 5000 usec. Bruce