aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ioprio.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:39:16 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:39:16 -0500
commitb6dff3ec5e116e3af6f537d4caedcad6b9e5082a (patch)
tree9e76f972eb7ce9b84e0146c8e4126a3f86acb428 /fs/ioprio.c
parent15a2460ed0af7538ca8e6c610fe607a2cd9da142 (diff)
CRED: Separate task security context from task_struct
Separate the task security context from task_struct. At this point, the security data is temporarily embedded in the task_struct with two pointers pointing to it. Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in entry.S via asm-offsets. With comment fixes Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/ioprio.c')
-rw-r--r--fs/ioprio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c
index 68d2cd807118..bb5210af77c2 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -32,8 +32,8 @@ static int set_task_ioprio(struct task_struct *task, int ioprio)
32 int err; 32 int err;
33 struct io_context *ioc; 33 struct io_context *ioc;
34 34
35 if (task->uid != current_euid() && 35 if (task->cred->uid != current_euid() &&
36 task->uid != current_uid() && !capable(CAP_SYS_NICE)) 36 task->cred->uid != current_uid() && !capable(CAP_SYS_NICE))
37 return -EPERM; 37 return -EPERM;
38 38
39 err = security_task_setioprio(task, ioprio); 39 err = security_task_setioprio(task, ioprio);
@@ -123,7 +123,7 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
123 break; 123 break;
124 case IOPRIO_WHO_USER: 124 case IOPRIO_WHO_USER:
125 if (!who) 125 if (!who)
126 user = current->user; 126 user = current->cred->user;
127 else 127 else
128 user = find_user(who); 128 user = find_user(who);
129 129
@@ -131,7 +131,7 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
131 break; 131 break;
132 132
133 do_each_thread(g, p) { 133 do_each_thread(g, p) {
134 if (p->uid != who) 134 if (p->cred->uid != who)
135 continue; 135 continue;
136 ret = set_task_ioprio(p, ioprio); 136 ret = set_task_ioprio(p, ioprio);
137 if (ret) 137 if (ret)
@@ -216,7 +216,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
216 break; 216 break;
217 case IOPRIO_WHO_USER: 217 case IOPRIO_WHO_USER:
218 if (!who) 218 if (!who)
219 user = current->user; 219 user = current->cred->user;
220 else 220 else
221 user = find_user(who); 221 user = find_user(who);
222 222
@@ -224,7 +224,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
224 break; 224 break;
225 225
226 do_each_thread(g, p) { 226 do_each_thread(g, p) {
227 if (p->uid != user->uid) 227 if (p->cred->uid != user->uid)
228 continue; 228 continue;
229 tmpio = get_task_ioprio(p); 229 tmpio = get_task_ioprio(p);
230 if (tmpio < 0) 230 if (tmpio < 0)