From: dnichols@ceilidh.beartrack.com (Don Nichols (DoN.))
Newsgroups: comp.sys.3b1
Subject: Re: tar and chown (was: Re: Cnews and dashes)
Date: 24 Jul 92 03:46:15 GMT
Organization: D and D Data, Vienna Virginia

In article <Brszsw.2o3@hico2.westmark.com> kak@hico2.westmark.com (Kris A. Kugel) writes:
>dnichols@ceilidh.beartrack.com (Don Nichols (DoN.)) writes:
>: ...but since chown(2) rights are reserved to root, the changes
>: never occur.  The authors of tar probably depended on this behavior of

	[ ... ]

>I seem to recall, (and have the manuals at home to check)
>that version 7 unix allowed chown(1) to change file ownership,
>and so I think that chown(2) for version 7 was NOT reserved for root.
>I believe that the chown action change was part of the
>the set of changes Berekley made to support accounting.
>(Why do they need this restriction?  Let's say I have a diskspace
> usage limit, so I make a big file -rw-rw-rw- and then chown it
> to somebody else, who then gets billed for the space usage.
> With the chown restriction, I can't do that trick anymore.
> This probably would make e-mail more popular for transfering files
> within a system, and make projects that required you be allowed
> "root" permission more popular. )

	Well, I have the manuals *RIGHT HERE*.  From my copy of _UNIX
Programmer's Manual_ ( Volume 1), revised and expanded edition, published by
Holt Rinehart and Winston, Copyright 1983, 1979, Bell Telephone Laboratories,
Incorporated:

Chown (1), third paragraph under DESCRIPTION heading:

	Only the super-user can change owner or group, in order to simplify
	as yet unimplemented accounting procedures.

Chown (2), DESCRIPTION:

	The file whose name is given by the null-terminated string pointed
	to by _name_ has its _owner_ and _group_ changed as specified.  Only
	the super-user may execute this call, because if users were able to
	give files away, they could defeat the (nonexistent) file-space
	accounting procedures.

	I would have included the on-line man pages from my old v7 on 68000,
but it is decomissioned at present, and it is too much trouble to dig them
out of backup tapes. :-) I remember them as being similar in content, if not
identical.  (BTW - the port of v7 in question was an early one by UniSoft.)

>Anyhow, as far as I know, Berekley DEVELOPED the chown restriction.

	Well, while my v7 *did* have some BSD influences, the manual from
which I was quoting probably does not (It doesn't even admit the existance
of csh(1)

	The only way that v7 chown could work for everyone would be if the
system administrator had made it suid-root, which could make it *very*
dangerous to have around.  (I admit the possibility of a re-written chown(1)
which could be safely suid-root, and check that the real uid matched the
file's owner before allowing the change.  If I were writing such a utility,
I would probably also log attempts which failed because the user did not own
the file in question. :-)

	If you still have access to that v7 system, (and it is still
running), I suggest that you check the man page for chown(2), and check
whether chown(1) has been made suid-root.
-- 
Donald Nichols (DoN.)     | Voice (Days): (703) 704-2280 (Eves): (703) 938-4564
D&D Data                  |  Email: <dnichols@ceilidh.beartrack.com>
I said it - no one else   |         <dnichols@ceilidh.aes.com>
	--- Black Holes are where God is dividing by zero ---
Newsgroups: comp.sys.3b1