Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_jail.c
| Show First 20 Lines • Show All 3,037 Lines • ▼ Show 20 Lines | #endif | ||||
| VOP_UNLOCK(pr->pr_root); | VOP_UNLOCK(pr->pr_root); | ||||
| if ((error = pwd_chroot_chdir(td, pr->pr_root))) | if ((error = pwd_chroot_chdir(td, pr->pr_root))) | ||||
| goto e_revert_osd; | goto e_revert_osd; | ||||
| newcred = crget(); | newcred = crget(); | ||||
| PROC_LOCK(p); | PROC_LOCK(p); | ||||
| oldcred = crcopysafe(p, newcred); | oldcred = crcopysafe(p, newcred); | ||||
| newcred->cr_prison = pr; | newcred->cr_prison = pr; | ||||
| proc_set_cred(p, newcred); | |||||
| setsugid(p); | |||||
| #ifdef RACCT | #ifdef RACCT | ||||
| racct_proc_ucred_changed(p, oldcred, newcred); | racct_proc_ucred_changed(p, oldcred, newcred); | ||||
| #endif | #endif | ||||
| #ifdef RCTL | #ifdef RCTL | ||||
| crhold(newcred); | crhold(newcred); | ||||
| #endif | #endif | ||||
| /* | |||||
| * Takes over 'newcred''s reference, so 'newcred' must not be used | |||||
| * besides this point except on RCTL where we took an additional | |||||
| * reference above. | |||||
| */ | |||||
| proc_set_cred(p, newcred); | |||||
| setsugid(p); | |||||
| PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
| #ifdef RCTL | #ifdef RCTL | ||||
| rctl_proc_ucred_changed(p, newcred); | rctl_proc_ucred_changed(p, newcred); | ||||
| crfree(newcred); | crfree(newcred); | ||||
| #endif | #endif | ||||
| prison_proc_relink(oldcred->cr_prison, pr, p); | prison_proc_relink(oldcred->cr_prison, pr, p); | ||||
| prison_deref(oldcred->cr_prison, drflags); | prison_deref(oldcred->cr_prison, drflags); | ||||
| crfree(oldcred); | crfree(oldcred); | ||||
| ▲ Show 20 Lines • Show All 2,461 Lines • Show Last 20 Lines | |||||