Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!cwruecmp!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.bugs.sys5 Subject: Re: Unlinking "." Message-ID: <2326@ncoast.UUCP> Date: Tue, 7-Apr-87 22:00:06 EST Article-I.D.: ncoast.2326 Posted: Tue Apr 7 22:00:06 1987 Date-Received: Sat, 11-Apr-87 05:21:14 EST References: <1059@cci632.UUCP> <5715@brl-smoke.ARPA> <736@killer.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.bugs.sys5 Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 36 As quoted from <736@killer.UUCP> by jfh@killer.UUCP (John Haugh): +--------------- | > In article <1059@cci632.UUCP> rrw@cci632.UUCP (Rick Wessman) writes: | > >In our version of Unix*, PERPOS**, it is legal to remove ".", and there | > >is a raging controversy about whether it should be. | | Doug is right about the races, but if you start moving all of the utilities | into the kernel, Sys5 will wind up looking a little fat. There are plenty | of good reasons to let people unlink "." and "..". Fix the races instead. +--------------- No, there aren't. When it was decided to go with a directed graph rather than an arbitrary linked mishmash, "." and ".." became sources of trouble. Unless you want to go back to the old format (and Ghod help fsck!), it's best to make the kernel force "." and ".." to be correct via mkdir()/rmdir()/ rename(). Otherwise you're asking for trouble. System V ld unlinks the destination if it encounters an error. I once tried to relink the sysV kernel (as root, due to file permissions) and did it wrong; ld tried to write ./.., failed for the obvious reasons, and unlinked the destination. Worse, fsck didn't let out a peep; I had to use /etc/link to fix it. This is a VERY good reason to make "." and ".." only linkable internal to the kernel and force mkdir()/rmdir()/rename() outside it. ++Brando -- ____ ______________ / \ / __ __ __ \ Brandon S. Allbery | QUOTE OF THE DAY: ___ | /__> / \ / \ aXcess Company | / \ | | `--, `--, 6615 Center St. #A1-105 | ` | | \__/ \__/ \__/ Mentor, OH 44060-4101 | \____/ \______________/ +1 216 974 9210 | cbatt!cwruecmp!ncoast!allbery ncoast!allbery%case.CSNET@relay.CS.NET BALLBERY (UUCP) (CSNET/Internet) (MCIMail)