Subject: Re: Setreuid in perl-4.036
To: None <kenh@wrl.EPI.COM, mark@aggregate.com>
From: Wolfgang Solfrank <ws@tools.de>
List: current-users
Date: 07/21/1994 20:45:19
> Finally, script_uid and script_gid are only used to assign back into the
> same fields farther down:
> 
> #ifdef SETUIDSCRIPTS
> 		/*
> 		 * set thing up so that set-id scripts will be
> 		 * handled appropriately
> 		 */
> 		epp->ep_vap->va_mode |= script_sbits;
> 		if (script_sbits & VSUID)
> 			epp->ep_vap->va_uid = script_uid;
> 		if (script_sbits & VSGID)
> 			epp->ep_vap->va_gid = script_gid;
> #endif
> 
> These fields aren't modified in between, so the variables xxxid aren't needed
> and the resetting of va_mode isn't required.

Sorry, this isn't correct.

The attributes ARE modified between the saving and what you call resetting.

Note that there is a recursice call to check_exec about 20 lines above the
code mentioned above. This routine changes the attributes from that of the
script to that of the interpreter. The intent of this so-called reset is that
the original caller of the check_exec gets attributes that describe the
intended effective uid and gid of the exec.

You are correct though with your first bug report regarding the script_sbits
variable.
--
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) +49-228-985800

------------------------------------------------------------------------------