n = PRIO_MAX;
if (n < PRIO_MIN)
n = PRIO_MIN;
- if (n < chgp->p_nice && priv_check_cred(cr, PRIV_ROOT, 0))
+ if (n < chgp->p_nice && priv_check_cred(cr, PRIV_SCHED_SETPRIORITY, 0))
return (EACCES);
chgp->p_nice = n;
FOREACH_LWP_IN_PROC(lp, chgp)
return EPERM;
}
/* disallow setting rtprio in most cases if not superuser */
- if (priv_check_cred(cr, PRIV_ROOT, 0)) {
+ if (priv_check_cred(cr, PRIV_SCHED_RTPRIO, 0)) {
/* can't set someone else's */
if (uap->pid) { /* XXX */
return EPERM;
cr->cr_ruid != p->p_ucred->cr_uid)
return (EPERM);
/* disallow setting rtprio in most cases if not superuser */
- if (priv_check_cred(cr, PRIV_ROOT, 0)) {
+ if (priv_check_cred(cr, PRIV_SCHED_RTPRIO, 0)) {
/* can't set someone else's */
if (uap->pid)
return (EPERM);
struct thread *td = curthread;
int error;
- if ((error = priv_check(td, PRIV_ROOT)))
+ if ((error = priv_check(td, PRIV_REBOOT)))
return (error);
boot(uap->opt);
{
int error;
- error = priv_check(req->td, PRIV_ROOT);
+ error = priv_check(req->td, PRIV_SYSCTL_DEBUG);
if (error)
return error;
sysctl_sysctl_debug_dump_node(&sysctl__children, 0);