From: Chmouel Boudjnah <chmouel@mandrakesoft.com>
To: Andrej.Borsenkow@mow.siemens.ru
Cc: cooker@linux-mandrake.com,
ZSH Workers Mailing List <zsh-workers@sunsite.dk>
Subject: Re: [Cooker] /bin/login from util-linux-2.11c-2mdk breaks zsh ctty hadling
Date: 08 Jun 2001 21:16:31 +0200 [thread overview]
Message-ID: <m366e6hje8.fsf@giants.mandrakesoft.com> (raw)
In-Reply-To: <3B1E9726.1090202@mail.ru> (Andrej Borsenkow's message of "Thu, 07 Jun 2001 00:48:38 +0400")
Andrej Borsenkow <arvidjaar@mail.ru> writes:
> Chmouel Boudjnah wrote:
>
> > Andrej Borsenkow <arvidjaar@mail.ru> 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
prev parent reply other threads:[~2001-06-08 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3B0BF59E.6030408@mow.siemens.ru>
[not found] ` <m3n183su14.fsf@giants.mandrakesoft.com>
2001-05-27 14:07 ` Andrej Borsenkow
2001-06-06 17:12 ` Chmouel Boudjnah
2001-06-06 20:48 ` Andrej Borsenkow
2001-06-08 19:16 ` Chmouel Boudjnah [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m366e6hje8.fsf@giants.mandrakesoft.com \
--to=chmouel@mandrakesoft.com \
--cc=Andrej.Borsenkow@mow.siemens.ru \
--cc=cooker@linux-mandrake.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).