FreeBSD/sys/kern/kern_prot.c
/*-
 * Change a process's real uid.
 * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo
 *               will be updated, and the old and new cr_ruidinfo proc
 *               counts will be updated.
 * References: newcred must be an exclusive credential reference for the
 *             duration of the call.
 */
Change a process's real uid.
Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo
will be updated, and the old and new cr_ruidinfo proc
counts will be updated.
References: newcred must be an exclusive credential reference for the
duration of the call.
Change a process ' s real uid . Side effects : newcred - > cr_ruid will be updated newcred - > cr_ruidinfo will be updated and the old and new cr_ruidinfo proc counts will be updated . References : newcred must be an exclusive credential reference for the duration of the call .
void
change_ruid(struct ucred *newcred, struct uidinfo *ruip)
{
	(void)chgproccnt(newcred->cr_ruidinfo, -1, 0);
	newcred->cr_ruid = ruip->ui_uid;
	uihold(ruip);
	uifree(newcred->cr_ruidinfo);
	newcred->cr_ruidinfo = ruip;
	(void)chgproccnt(newcred->cr_ruidinfo, 1, 0);
}
void change_ruid ( struct ucred * newcred , struct uidinfo * ruip ) { ( void ) chgproccnt ( newcred -> cr_ruidinfo , -1 , 0 ) ; newcred -> cr_ruid = ruip -> ui_uid ; uihold ( ruip ) ; uifree ( newcred -> cr_ruidinfo ) ; newcred -> cr_ruidinfo = ruip ; ( void ) chgproccnt ( newcred -> cr_ruidinfo , 1 , 0 ) ; }
Change a process's real uid.
Change a process ' s real uid .