- * 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. */
| 2436 | * duration of the call. |
| 2437 | */ |
| 2438 | void |
| 2439 | change_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. |
no test coverage detected