lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ioprio: Allow CAP_SYS_NICE to set IOPRIO_CLASS_RT
sched_setscheduler allows a process with CAP_SYS_NICE to set
real-time policy. Let ioprio_set follow this.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
fs/ioprio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ioprio.c b/fs/ioprio.c
index e50170c..155b51e 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -70,7 +70,7 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)

switch (class) {
case IOPRIO_CLASS_RT:
- if (!capable(CAP_SYS_ADMIN))
+ if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
return -EPERM;
/* fall through, rt has prio field too */
case IOPRIO_CLASS_BE:
--
1.7.10.4


\
 
 \ /
  Last update: 2013-01-31 13:02    [W:0.053 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site