[TUHS] History of chown semantics

Armando Stettner aps at ieee.org
Fri Jan 10 05:48:30 AEST 2014


Dos this mean that on some implementations of UNIX, that the chown(2) was usable by non-root processes???  Maybe I misremembered but I thought that that would fail - even the chown(1) would fail - if the invoking process (or shell in the case of chown(1)) was not superuser.  If it was allowed to change owners, surely it wouldn't allow one to chown to root.  (Sorry about calling you Surely.)

  aps.


Begin forwarded message:

> From: Clem Cole <clemc at ccc.com>
> Subject: Re: [TUHS] History of chown semantics
> Date: January 9, 2014 10:48:04 AM PST
> To: Ron Natalie <ron at ronnatalie.com>
> Cc: TUHS main list <tuhs at minnie.tuhs.org>
> 
> Right ...  tools like tar(1) called the system call directly,
> Which is why the restriction/check in the research family was done in the OS.
> The PWB kernel did not make the check - although V6 did:
> 
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/sys/ken/sys4.c
> chown()
> {
> 	register *ip;
> 
> 	if (
> !suser() 
> || (ip = owner()) == NULL)
> 		return;
> 	ip->i_uid = u.u_arg[1].lobyte;
> 	ip->i_gid = u.u_arg[1].hibyte;
> 	ip->i_flag =| IUPD;
> 	iput(ip);
> }
> 
> 
> 
> Where as: PWB 1.0:
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/sys/sys/os/sys4.c
> chown()
> {
> 	register *ip;
> 
> 	if ((ip = owner()) == NULL)
> 		return;
> 	ip->i_uid = u.u_arg[1].lobyte;
> 	ip->i_gid = u.u_arg[1].hibyte;
> 	if(u.u_uid != 0)
> 		ip->i_mode =& ~(ISUID|ISGID);
> 	ip->i_flag =| IUPD;
> 	iput(ip);
> }
> 
> 
> Clem
> 
> 
> On Thu, Jan 9, 2014 at 1:31 PM, Ron Natalie <ron at ronnatalie.com> wrote:
> There's no real point in restricting the chown program if the system call
> remains executable by non-root.
> 
> -----Original Message-----
> From: tuhs-bounces at minnie.tuhs.org [mailto:tuhs-bounces at minnie.tuhs.org] On
> Behalf Of Dario Niedermann
> Sent: Thursday, January 9, 2014 1:18 PM
> To: tuhs at minnie.tuhs.org
> Subject: Re: [TUHS] History of chown semantics
> 
> Il 09/01/2014 alle 15:56, Clem Cole ha scritto:
> 
> > I agree with you, I always thought it was crazy [...]
> 
> Maybe I'm missing something, but it seems easy enough to make the `chown'
> program only executable by root.
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs
> 
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs
> 
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs



More information about the TUHS mailing list