From: <ha...@no...> - 2002-05-21 15:09:36
|
> It seemes that setsid() does not set 'leader' flag for masq-ed > processes. This probably may be fixed in bproc-3.1.10/kernel/masq.c: > > int masq_setsid(void) { > ... > current->bproc.masq->session > = current->bproc.masq->pgrp > = current->bproc.masq->pid; > current->leader = 1; /* this line added by Vaclav Hanzl */ > return current->bproc.masq->pgrp; This fix is not enough, also the condition testing setsid() result from ghost is probably wrong. Seemes it should be: int masq_setsid(void) { ... result = req->req.result; bproc_put_req(req); /*if (result == 0) { VH: wrong test - result is session id or -1 */ if (result > 0) { /* Ok, setsid succeeded for the ghost. Now we have to do the same * thing to ourselves on this side */ current->bproc.masq->session = current->bproc.masq->pgrp = current->bproc.masq->pid; current->leader = 1; /* this line added by Vaclav Hanzl */ /* VH: now result == current->bproc.masq->pid */ return current->bproc.masq->pgrp; } else { ... But it probably still is not enough. Now sshd seemes happy but bash started on slave node goes to busy loop: --- SIGTTIN (Stopped (tty input)) --- rt_sigaction(SIGTTIN, {SIG_IGN}, {SIG_DFL}, 8) = 0 ioctl(255, 0x540f, [0]) = 0 rt_sigaction(SIGTTIN, {SIG_DFL}, {SIG_IGN}, 8) = 0 kill(0, SIGTTIN) = 0 --- SIGTTIN (Stopped (tty input)) --- rt_sigaction(SIGTTIN, {SIG_IGN}, {SIG_DFL}, 8) = 0 ioctl(255, 0x540f, [0]) = 0 rt_sigaction(SIGTTIN, {SIG_DFL}, {SIG_IGN}, 8) = 0 kill(0, SIGTTIN) = 0 Yes, I probably stepped out to empty spaces yet to be filled by bproc-ing ttys. Anybody cares about this or not? Best Regards Vaclav |