From owner-freebsd-bugs Thu Jul 30 23:40:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA11183 for freebsd-bugs-outgoing; Thu, 30 Jul 1998 23:40:07 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA11098 for ; Thu, 30 Jul 1998 23:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id XAA03318; Thu, 30 Jul 1998 23:40:00 -0700 (PDT) Date: Thu, 30 Jul 1998 23:40:00 -0700 (PDT) Message-Id: <199807310640.XAA03318@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Bruce Evans Subject: Re: bin/7444: login exited on Signal 3, core dumped Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/7444; it has been noted by GNATS. From: Bruce Evans To: freebsd-bugs@FreeBSD.ORG, woods@zeus.leitch.com Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/7444: login exited on Signal 3, core dumped Date: Fri, 31 Jul 1998 16:35:00 +1000 > That's trivial to reproduce, and mostly harmless. Just type a bogus > user-id at the initial login prompt (i.e. the one given by getty), then > a bogus password (eg. ), and at the second login prompt type > (i.e. the default quit character). You should see the syslog > message and a new getty prompt at the same time. SIGQUIT is supposed to > cause a core dump -- that's the whole idea behind having it. > > The fix would be to have login trap and ignore SIGQUIT, but I don't know > that it's necessary. Such a fix should be wrapped in #ifndef DEBUG or > something similar (IMO). Non-broken versions of login ignore SIGQUIT throughout. The -current version ignores it for the getpass() call only, so CTRL-\ at the password prompt dumps core but CTRL-\ at the login prompt doesn't. The -"stable" version ignores it beginning with the first call to getpass(), so CTRL-\ dumps core at all prompts except the first login prompt. The history of this bug is farcial: getpass.c 1.3 (1995/12/27): Don't block SIGINT in getpass(). This had no effect for login because login ignored SIGINT throughout, but other callers of getpass() may have been adversely affected. getpass.c 1.4 (1995/12/31): Break SIGINT and SIGTSTP by catching them and doing some wrong things in the signal handler instead of ignoring them. Break SIGQUIT and SIGSTOP by catching them instead of doing nothing with them. RELENG_2_2 branch: Inherit bugs in getpass.c 1.5. login.c 1.31 (1998/02/05): Work around one bug in getpass.c 1.4. The signal handler for SIGINT/SIGQUIT turns on echo and sends another signal (to be handled in the caller's environment). This is wrong if the caller is ignoring the signal - getpass() continues with the password being echoed. Call getpass() with SIGINT/SIGQUIT defaulted, so that CTRL-C and CTRL-\ terminate login. Ignore SIGINT/SIGQUIT again after getpass() returns. getpass.c 1.6 (1998/02/18): Fix 1.3 and 1.4 as a side effect of sort of switching to the NetBSD version. Confuse the issue in the log message by referring to the cosmetic (on i386's) POSIXifications and not the bugs. getpass.c 1.5.2.1 (1998/02/17): Merge 1.6 into -stable. Log more confusion about POSIXification. login.c 1.12.2.9 (1998/02/18): Merge just half the change from 1.31 into -"stable" together with one line of Kerberos changes and one line of style bugs. This leaves SIGINT/SIGQUIT defaulted forever after the first call to getpass(). The future history should be: login.c: Back out 1.31 and the buggy half of 1.12.2.9. Who needs CTRL-\ to give core dumps in login? getpass.c: Copy the NetBSD version or back out to 1.2 and POSIXify without leaving ugly vestiges of 1.4 (auto variables became static so that they could be abused by the signal handler ...). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message