aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorCedric Le Goater <clg@fr.ibm.com>2006-12-08 05:37:54 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:51 -0500
commit937949d9edbf4049bd41af6c9f92c26280584564 (patch)
treed0a28f503b082f890cfa1f7fe952fda8fc771752 /kernel/sys.c
parentef55d53caa055aedee13e77da82740987dd64f2d (diff)
[PATCH] add process_session() helper routine
Replace occurences of task->signal->session by a new process_session() helper routine. It will be useful for pid namespaces to abstract the session pid number. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 1ac2d1c5d84e..4f9d23a3095f 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1381,7 +1381,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1381 1381
1382 if (p->real_parent == group_leader) { 1382 if (p->real_parent == group_leader) {
1383 err = -EPERM; 1383 err = -EPERM;
1384 if (p->signal->session != group_leader->signal->session) 1384 if (process_session(p) != process_session(group_leader))
1385 goto out; 1385 goto out;
1386 err = -EACCES; 1386 err = -EACCES;
1387 if (p->did_exec) 1387 if (p->did_exec)
@@ -1400,7 +1400,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1400 struct task_struct *p; 1400 struct task_struct *p;
1401 1401
1402 do_each_task_pid(pgid, PIDTYPE_PGID, p) { 1402 do_each_task_pid(pgid, PIDTYPE_PGID, p) {
1403 if (p->signal->session == group_leader->signal->session) 1403 if (process_session(p) == process_session(group_leader))
1404 goto ok_pgid; 1404 goto ok_pgid;
1405 } while_each_task_pid(pgid, PIDTYPE_PGID, p); 1405 } while_each_task_pid(pgid, PIDTYPE_PGID, p);
1406 goto out; 1406 goto out;
@@ -1459,7 +1459,7 @@ asmlinkage long sys_getpgrp(void)
1459asmlinkage long sys_getsid(pid_t pid) 1459asmlinkage long sys_getsid(pid_t pid)
1460{ 1460{
1461 if (!pid) 1461 if (!pid)
1462 return current->signal->session; 1462 return process_session(current);
1463 else { 1463 else {
1464 int retval; 1464 int retval;
1465 struct task_struct *p; 1465 struct task_struct *p;
@@ -1471,7 +1471,7 @@ asmlinkage long sys_getsid(pid_t pid)
1471 if (p) { 1471 if (p) {
1472 retval = security_task_getsid(p); 1472 retval = security_task_getsid(p);
1473 if (!retval) 1473 if (!retval)
1474 retval = p->signal->session; 1474 retval = process_session(p);
1475 } 1475 }
1476 read_unlock(&tasklist_lock); 1476 read_unlock(&tasklist_lock);
1477 return retval; 1477 return retval;