MCPcopy Create free account
hub / github.com/F-Stack/f-stack / change_ruid

Function change_ruid

freebsd/kern/kern_prot.c:2438–2448  ·  view source on GitHub ↗

- * 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. */

Source from the content-addressed store, hash-verified

2436 * duration of the call.
2437 */
2438void
2439change_ruid(struct ucred *newcred, struct uidinfo *ruip)
2440{
2441
2442 (void)chgproccnt(newcred->cr_ruidinfo, -1, 0);
2443 newcred->cr_ruid = ruip->ui_uid;
2444 uihold(ruip);
2445 uifree(newcred->cr_ruidinfo);
2446 newcred->cr_ruidinfo = ruip;
2447 (void)chgproccnt(newcred->cr_ruidinfo, 1, 0);
2448}
2449
2450/*-
2451 * Change a process's real gid.

Callers 3

kern_prot.cFile · 0.85
sys_setreuidFunction · 0.85
sys_setresuidFunction · 0.85

Calls 3

uiholdFunction · 0.85
uifreeFunction · 0.85
chgproccntFunction · 0.70

Tested by

no test coverage detected