[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Fix setsid(0)
From: |
Thomas Bushnell BSG |
Subject: |
Re: [RFC] Fix setsid(0) |
Date: |
Tue, 17 Jan 2006 11:41:15 -0800 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> [hurd]/proc/Changelog
> 2006-01-17 Samuel Thibault <samuel.thibault@ens-lyon.org>
>
> 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;
Thanks for the discussion.
This patch seems like the right idea.
1: You should remove the comment that CALLERP is ignored.
2: CALLERP may be null if the RPC is received on the wrong kind of
port (in which case EOPNOTSUPP should be returned).
Can you propose a revised patch?
Thomas