Commit 02bdc207 authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] signal error return fix

parent 36dc13b9
...@@ -907,6 +907,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) ...@@ -907,6 +907,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
p = find_task_by_pid(pid); p = find_task_by_pid(pid);
if (!p) if (!p)
goto out; goto out;
err = -EINVAL; err = -EINVAL;
if (!thread_group_leader(p)) if (!thread_group_leader(p))
goto out; goto out;
...@@ -918,11 +919,16 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) ...@@ -918,11 +919,16 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
err = -EACCES; err = -EACCES;
if (p->did_exec) if (p->did_exec)
goto out; goto out;
} else if (p != current) } else {
goto out; err = -ESRCH;
if (p != current)
goto out;
}
err = -EPERM; err = -EPERM;
if (p->leader) if (p->leader)
goto out; goto out;
if (pgid != pid) { if (pgid != pid) {
struct task_struct *p; struct task_struct *p;
struct pid *pid; struct pid *pid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment