+Thu Jun 5 15:56:54 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * login.c: Always use the new tty line discpline. [krb5-appl/428]
+
+ * login.c: If a hangup signal is received, pass it onto the child.
+ [krb5-appl/432]
+
Fri Mar 28 01:05:27 1997 Theodore Y. Ts'o <tytso@mit.edu>
* login.c (NO_MOTD): If we're on an SGI machine, don't do the MOTD
if (*pwd->pw_shell == '\0')
pwd->pw_shell = BSHELL;
#if defined(NTTYDISC) && defined(TIOCSETD)
- /* turn on new line discipline for the csh */
- if (!strcmp(pwd->pw_shell, "/bin/csh")) {
- ioctlval = NTTYDISC;
- (void)ioctl(0, TIOCSETD, (char *)&ioctlval);
- }
+ /* turn on new line discipline for all shells */
+ ioctlval = NTTYDISC;
+ (void)ioctl(0, TIOCSETD, (char *)&ioctlval);
#endif
ccname = getenv("KRB5CCNAME"); /* save cache */
}
#if defined(KRB4_GET_TICKETS) || defined(KRB5_GET_TICKETS)
+
+static int hungup = 0;
+static sigtype
+sighup() {
+ hungup = 1;
+}
+
/* call already conditionalized on login_krb4_get_tickets */
/*
* This routine handles cleanup stuff, and the like.
void
dofork()
{
- int child;
-
+ int child,pid;
+ handler sa;
+
#ifdef _IBMR2
update_ref_count(1);
#endif
(void) chdir("/"); /* Let's not keep the fs busy... */
/* If we're the parent, watch the child until it dies */
+
+ /* On receipt of SIGHUP, pass that along to child's process group. */
+ handler_init (sa, sighup);
+ handler_set (SIGHUP, sa);
+
+ while (1) {
#ifdef HAVE_WAITPID
- (void)waitpid(child, 0, 0);
+ pid = waitpid(child, 0, 0);
#else
#ifdef WAIT_USES_INT
- while(wait((int *)0) != child) /*void*/ ;
+ pid = wait((int *)0);
#else
- while(wait((union wait *)0) != child) /*void*/ ;
+ pid = wait((union wait *)0);
#endif
#endif
+ if (hungup)
+ killpg(child, SIGHUP);
+ if (pid == child)
+ break;
+ }
/* Cleanup stuff */
/* Run destroy_tickets to destroy tickets */