Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/sys_capability.c
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | if (IN_CAPABILITY_MODE(td)) | ||||
return (0); | return (0); | ||||
newcred = crget(); | newcred = crget(); | ||||
p = td->td_proc; | p = td->td_proc; | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
oldcred = crcopysafe(p, newcred); | oldcred = crcopysafe(p, newcred); | ||||
newcred->cr_flags |= CRED_FLAG_CAPMODE; | newcred->cr_flags |= CRED_FLAG_CAPMODE; | ||||
proc_set_cred(p, newcred); | proc_set_cred(p, newcred); | ||||
FOREACH_THREAD_IN_PROC(p, td) { | |||||
thread_lock(td); | |||||
if (TD_IS_SUGID(td)) { | |||||
td->td_ucred->cr_flags |= CRED_FLAG_CAPMODE; | |||||
} | |||||
thread_unlock(td); | |||||
} | |||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
crfree(oldcred); | crfree(oldcred); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* System call to query whether the process is in capability mode. | * System call to query whether the process is in capability mode. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 546 Lines • Show Last 20 Lines |