Hi,

Currently, setsid(0) always return 1, while it should return the sid of
the calling process.  Here is a proposed patch:

[hurd]/proc/Changelog
2006-01-17  Samuel Thibault  <[EMAIL PROTECTED]>

        Fix setsid(0).

        * pgrp.c (S_proc_getsid): When pid == 0, use `callerp' argument
        instead of pid_find(pid).

Index: pgrp.c
===================================================================
RCS file: /cvsroot/hurd/hurd/proc/pgrp.c,v
retrieving revision 1.23
diff -u -p -r1.23 pgrp.c
--- hurd/proc/pgrp.c    8 May 2002 09:24:52 -0000       1.23
+++ hurd/proc/pgrp.c    17 Jan 2006 02:59:59 -0000
@@ -141,7 +141,11 @@ S_proc_getsid (struct proc *callerp,
             pid_t pid,
             pid_t *sid)
 {
-  struct proc *p = pid_find (pid);
+  struct proc *p;
+  if (pid == 0)
+    p = callerp;
+  else
+    p = pid_find (pid);
   if (!p)
     return ESRCH;
 


_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to