From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4623 invoked from network); 8 Jun 2001 19:17:05 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jun 2001 19:17:05 -0000 Received: (qmail 3820 invoked by alias); 8 Jun 2001 19:16:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14816 Received: (qmail 3809 invoked from network); 8 Jun 2001 19:16:45 -0000 To: Andrej.Borsenkow@mow.siemens.ru Cc: cooker@linux-mandrake.com, ZSH Workers Mailing List Subject: Re: [Cooker] /bin/login from util-linux-2.11c-2mdk breaks zsh ctty hadling References: <3B0BF59E.6030408@mow.siemens.ru> <3B110A3F.4020802@mail.ru> <3B1E9726.1090202@mail.ru> From: Chmouel Boudjnah Date: 08 Jun 2001 21:16:31 +0200 In-Reply-To: <3B1E9726.1090202@mail.ru> (Andrej Borsenkow's message of "Thu, 07 Jun 2001 00:48:38 +0400") Message-ID: User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Andrej Borsenkow writes: > Chmouel Boudjnah wrote: > > > Andrej Borsenkow writes: > > > > > >>O.K., I have found why it happens. Here goes. > >> > > > > ok fixed in latest util-linux of cooker.. > > > > > > No, sorry. It now tries to open /dev/tty but in wrong place - in parent, > not in child. ok i understand now, the setsid is definitvely broken (for ash shell :-(), i'll revert the changes here, can you try this[1] : --- util-linux-2.11e/login-utils/login.c.chmou Thu Jun 7 20:49:09 2001 +++ util-linux-2.11e/login-utils/login.c Fri Jun 8 21:14:03 2001 @@ -1071,15 +1071,8 @@ * We must fork before setuid() because we need to call * pam_close_session() as root. */ - /* - * Problem: if the user's shell is a shell like ash that doesnt do - * setsid() or setpgrp(), then a ctrl-\, sending SIGQUIT to every - * process in the pgrp, will kill us. - * Solution: use TIOCNOTTY and setsid(). - */ signal(SIGINT, SIG_IGN); - signal(SIGHUP, SIG_IGN); /* ignore signal from TIOCNOTTY below */ - + childPid = fork(); if (childPid < 0) { int errsv = errno; @@ -1088,18 +1081,11 @@ PAM_END; exit(0); } else if (childPid) { - /* parent - wait for child to finish, then cleanup session */ - ioctl(0, TIOCNOTTY, NULL); - signal(SIGHUP, SIG_DFL); - wait(NULL); PAM_END; exit(0); } /* child */ - setsid(); - /* reopen, as we need controlling tty in the child */ - opentty(ttyn); #endif signal(SIGHUP, SIG_DFL); signal(SIGINT, SIG_DFL); Footnotes: [1] or get the file https://qa.mandrakesoft.com/~chmou/misc/login