Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.unix.questions Subject: Re: removing hard linked directories Message-ID: <7RQ&P*=@warwick.ac.uk> Date: 25 Mar 91 17:19:32 GMT References: <1991Mar20.013744.12749@ux1.cso.uiuc.edu> <1991Mar20.115508.25638@athena.mit.edu> <1991Mar21.025311.9821@nmt.edu> Sender: news@warwick.ac.uk (Network news) Organization: Computing Services, Warwick University, UK Lines: 34 Nntp-Posting-Host: shark In article <1991Mar21.025311.9821@nmt.edu> rmilner@zia.aoc.nrao.edu (Ruth Milner) writes: >In article <1991Mar20.115508.25638@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes: >>the problem you are having is just one of the many reasons why the man pages >>for ln(1) and link(2) say that you shouldn't create hard links to >>directories. > >So would somebody please tell me why "mv" will do this? For a long time SunOS had a bug where if you had a sticky /tmp directory, and you tried to move someone else's directory, rename() would create a new link to the directory, try to unlink the old one, fail, try to unlink the new one, and fail. Then I'd come along as super-user and try to /etc/unlink the new version, and it would fail. The only way out was to halt the machine and do a manual fsck (the automatic fsck would just let it pass as you say). I complained to Sun that a) rename() shouldn't leave these extraneous links around and b) unlink should allow them to be removed even if they did, but the people I talked to at Sun seemed to think this was a feature, which would not be fixed. Meanwhile we've gone to SunOS 4.1{,.1}, and I don't know if the problem still exists, it's too much of a pain to try it out. No doubt next term we'll get a new batch of these fun links called "Freddy you're a bozo" which seem to amuse some of the undergraduates, and I'll be complaining to Sun again. Cheers, Rob -- UUCP: ...!mcsun!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick INET: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England