Message ID | 200909291547.21528.borntraeger@de.ibm.com |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
On 09/29, Christian Borntraeger wrote: > > --- linux-2.6.orig/kernel/sys.c > +++ linux-2.6/kernel/sys.c > @@ -1110,6 +1110,8 @@ SYSCALL_DEFINE0(setsid) > err = session; > out: > write_unlock_irq(&tasklist_lock); > + if (!err) > + proc_sid_connector(sid); sys_setsid() returns the session nr on success, not zero. if (err > 0) proc_sid_connector(sid); Otherwize I think the patch is fine. Not only it should fix the problem, imho it makes the code cleaner. If Scott still thinks daemonize() should report too, we can change it. (I'd suggest you to CC Andrew if you are going to re-send) Oleg. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Index: linux-2.6/kernel/exit.c =================================================================== --- linux-2.6.orig/kernel/exit.c +++ linux-2.6/kernel/exit.c @@ -359,10 +359,8 @@ void __set_special_pids(struct pid *pid) { struct task_struct *curr = current->group_leader; - if (task_session(curr) != pid) { + if (task_session(curr) != pid) change_pid(curr, PIDTYPE_SID, pid); - proc_sid_connector(curr); - } if (task_pgrp(curr) != pid) change_pid(curr, PIDTYPE_PGID, pid); Index: linux-2.6/kernel/sys.c =================================================================== --- linux-2.6.orig/kernel/sys.c +++ linux-2.6/kernel/sys.c @@ -1110,6 +1110,8 @@ SYSCALL_DEFINE0(setsid) err = session; out: write_unlock_irq(&tasklist_lock); + if (!err) + proc_sid_connector(sid); return err; }