aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
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;