Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Cooker] /bin/login from util-linux-2.11c-2mdk breaks zsh ctty hadling
- X-seq: zsh-workers 14816
- From: Chmouel Boudjnah <chmouel@xxxxxxxxxxxxxxxx>
- To: Andrej.Borsenkow@xxxxxxxxxxxxxx
- Subject: Re: [Cooker] /bin/login from util-linux-2.11c-2mdk breaks zsh ctty hadling
- Date: 08 Jun 2001 21:16:31 +0200
- Cc: cooker@xxxxxxxxxxxxxxxxxx, ZSH Workers Mailing List <zsh-workers@xxxxxxxxxx>
- In-reply-to: <3B1E9726.1090202@xxxxxxx> (Andrej Borsenkow's message of "Thu, 07 Jun 2001 00:48:38 +0400")
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3B0BF59E.6030408@xxxxxxxxxxxxxx> <m3n183su14.fsf@xxxxxxxxxxxxxxxxxxxxxxx> <3B110A3F.4020802@xxxxxxx> <m3zoblcz1w.fsf@xxxxxxxxxxxxxxxxxxxxxxx> <3B1E9726.1090202@xxxxxxx>
Andrej Borsenkow <arvidjaar@xxxxxxx> writes:
> Chmouel Boudjnah wrote:
>
> > Andrej Borsenkow <arvidjaar@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author