Use priv_check(9) instead of suser(9) for checking the privilege to

set real-time priority on a thread.  It looks like this suser(9)
call was introduced after my first pass through replacing superuser
checks with named privilege checks.
This commit is contained in:
Robert Watson 2007-02-19 13:22:36 +00:00
parent c3c1b5e62a
commit 86138fc742
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166828

View file

@ -330,7 +330,7 @@ rtprio_thread(struct thread *td, struct rtprio_thread_args *uap)
break;
/* Disallow setting rtprio in most cases if not superuser. */
if (suser(td) != 0) {
if (priv_check(td, PRIV_SCHED_RTPRIO) != 0) {
/* can't set realtime priority */
/*
* Realtime priority has to be restricted for reasons which should be