4.2bsd Oddity (BUG?)

Robert Elz kre at munnari.OZ
Tue Dec 17 07:43:41 AEST 1985


In article <729 at brl-tgr.ARPA>, gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:
> The owner of the parent directory should be able to "mv"
> the subdirectory elsewhere ...

I assume that Doug chose the words "should be able" very carefully.
This cannot be done of course, as to move a directory, you have to
change its back pointer (".."), and that involves writing in the (child)
directory, which means that you have to have write permission in there...

[Aside: I know that manipulating directories is a root only function,
and root has permission to do anything, all that is irrelevant, the
setuid programs that implement this, or the kernel sys calls that
replaced them in 4.2, implement the same protection checks].

This is a logical outcome of the file system protection design,
to change it would break some of the regularity of the whole
thing.  Whether that's important in this case is another matter
entirely.  This is also not a 4.2 "problem", this has existed in
all of the research unix versions, since v5 at least.  I have no
idea what USG/USDL may have done in this area, but I suspect its
probably the same in the Sys N releases too.

Robert Elz	seismo!munnari!kre	kre%munnari.oz at seismo.css.gov



More information about the Comp.unix.wizards mailing list