Newsgroups: comp.os.minix
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!solace!news.stealth.net!www.nntp.primenet.com!nntp.primenet.com!howland.erols.net!surfnet.nl!newshost.vu.nl!cs.vu.nl!kjb
From: kjb@cs.vu.nl (Kees J Bot)
Subject: Re: rename() system call
Nntp-Posting-Host: hornet.cs.vu.nl
References: <326CECE7.521E@s3.com> <54j7v8$b7i@newstand.syr.edu> <54lbk9$5ni@trumpet.uni-mannheim.de>
Sender: news@cs.vu.nl
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Date: Sat, 26 Oct 1996 09:11:08 GMT
Message-ID: <DzvLIL.4s8@cs.vu.nl>
Lines: 23

fs29@rumpelkammer.uni-mannheim.de (User fs29) writes:

>rename() is atomic. The following situation cannot occur when using rename():
[snip]

I believe you are all looking a bit to deep.  Link() and unlink() cannot
be used on directories by anyone but the superuser to prevent people
from messing up the directory structure.  So under Version 7 UNIX the
commands 'mkdir', 'rmdir', and 'mv' were set-uid root to allow them to
work on directories.

This also means that a user program wanting to do something with
directories had to execute one of these programs.  Someone got wise and
invented mkdir(2), rmdir(2), and rename(2) to make things simpler for
the programmer (and less simple for the kernel.)

Many UNIX variants now disallow link() and unlink() on directories even
for the superuser, because they are not really needed anymore and it is
a lot safer that way.
--
long:  http://www.cs.vu.nl/~ast/minix.html         Kees J. Bot  (kjb@cs.vu.nl)
short: http://www.cs.vu.nl/ftp/minix/README.html        Systems Programmer
ftp:   ftp://ftp.cs.vu.nl/pub/minix/		   Vrije Universiteit Amsterdam
