lkml.org 
[lkml]   [2003]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] fix setpgid
In patch-2.5.37 a return code of setpgid(pid,pgid) was broken.
If pid is not the current process and is not a child of
the current process it should return ESRCH, but the 2.5.37
patch turned this into EINVAL. The below fixes this again.

Andries

--- /linux/2.5/linux-2.5.59/linux/kernel/sys.c Tue Dec 10 18:42:42 2002
+++ /linux/2.5/linux-2.5.59a/linux/kernel/sys.c Mon Jan 20 22:04:52 2003
@@ -916,6 +916,7 @@
p = find_task_by_pid(pid);
if (!p)
goto out;
+
err = -EINVAL;
if (!thread_group_leader(p))
goto out;
@@ -927,8 +928,12 @@
err = -EACCES;
if (p->did_exec)
goto out;
- } else if (p != current)
- goto out;
+ } else {
+ err = -ESRCH;
+ if (p != current)
+ goto out;
+ }
+
err = -EPERM;
if (p->leader)
goto out;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.026 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site