chown - right or privilege - (nf)

Guy Harris guy at rlgvax.UUCP
Wed Oct 26 02:28:26 AEST 1983


If you are referring to things like "at", where the user on whose behalf the
batch script is run is assumed to be the user that owns the file, there is a
simple fix.  There already exists in UNIX a facility where a user can get the
privileges of the owner of a file by using that file; the set-UID facility.
The USG systems that allow you to give a file away (and, unless you're the
super-user, that's *all* they allow you to do with the file's ownership) solve
this by turning off the set-UID bit on a file if you give it away to another
and turning off the set-GID bit if you change the group (again, unless you are
the super-user).  For any file where you use the owner UID to grant permissions,
simply require that file to have its set-UID bit on.  Then, if anybody tries
to give the file away to somebody in order to get that person's permissions,
the kernel will force the set-UID bit off and your program will refuse to let
the guy in.

In our environment it's rare that you'd want to give a file away (we use our
machine for program development, mostly) but somebody working at one of our
sales offices (OZ, if you know him) points out that in an office system (which
is what we sell on our UNIX boxes) you might create a memo for somebody else
and then want to turn ownership of that memo over to them, so in a lot of cases
it may be very useful to be able to give files away.

	Guy Harris
	{seismo,mcnc,brl-bmd,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list