From owner-freebsd-hackers Fri Sep 13 23:21:50 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA08364 for hackers-outgoing; Fri, 13 Sep 1996 23:21:50 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id XAA08358 for ; Fri, 13 Sep 1996 23:21:46 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id QAA05920; Sat, 14 Sep 1996 16:15:34 +1000 Date: Sat, 14 Sep 1996 16:15:34 +1000 From: Bruce Evans Message-Id: <199609140615.QAA05920@godzilla.zeta.org.au> To: freebsd-hackers@FreeBSD.ORG, pius@iago.ienet.com Subject: Re: How to safely remove a hard link to a directory? Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Sorry, a short follow-up ... I just ran across an old message >from Joerg Wunsch on the mailing list archives ... Is it still >safe to just call unlink(2) on the directory name to remove the >hard link? It depends where the link goes. It is fairly safe to remove bogus links that you just created. >Why does rmdir not work? ufs_rmdir() has a fairly bogus check that the link count is 2. If it checks it at all, then it should check that one of the links is for ".". Bruce