Add a new priv 'PRIV_SCHED_CPUSET' to check if manipulating cpusets is

allowed and replace the suser() call. Do not allow it in jails.

Reviewed by:	rwatson
This commit is contained in:
Bjoern A. Zeeb 2008-06-29 17:58:16 +00:00
parent 6b2bbb0465
commit ba931c0855
2 changed files with 2 additions and 1 deletions

View File

@ -292,7 +292,7 @@ cpuset_modify(struct cpuset *set, cpuset_t *mask)
struct cpuset *root;
int error;
error = suser(curthread);
error = priv_check(curthread, PRIV_SCHED_CPUSET);
if (error)
return (error);
/*

View File

@ -187,6 +187,7 @@
#define PRIV_SCHED_SETPOLICY 203 /* Can set scheduler policy. */
#define PRIV_SCHED_SET 204 /* Can set thread scheduler. */
#define PRIV_SCHED_SETPARAM 205 /* Can set thread scheduler params. */
#define PRIV_SCHED_CPUSET 206 /* Can manipulate cpusets. */
/*
* POSIX semaphore privileges.