Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.os.minix Subject: Re: Request for help with rmdir bug Message-ID: <8135@utzoo.UUCP> Date: Mon, 8-Jun-87 15:13:02 EDT Article-I.D.: utzoo.8135 Posted: Mon Jun 8 15:13:02 1987 Date-Received: Mon, 8-Jun-87 15:13:02 EDT References: <1195@botter.cs.vu.nl> Organization: U of Toronto Zoology Lines: 16 > The question is: does anyone have an idea how to make rmdir work without > modifying the kernel. Unlinking the directory before removing . and .. > does not sound like a good idea. This is a known bug in old Unixes. The simplest approach is to have rmdir disallow removals of directories with pathnames involving "." or "..". The fundamental problem is that the removal of the three links is not an atomic operation. Even if one fixes rmdir to be proof against tricky pathnames, more subtle problems can arise because in a multiprogramming system, other things can be manipulating the directories at the same time. The only complete fix for race conditions and such is to move the mkdir and rmdir operations into the kernel. -- "There is only one spacefaring Henry Spencer @ U of Toronto Zoology nation on Earth today, comrade." {allegra,ihnp4,decvax,pyramid}!utzoo!henry