[2099] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Small bug in appl/bsd/krlogin.c

daemon@ATHENA.MIT.EDU (Ken Hornstein)
Mon Jul 15 02:34:49 1996

To: krb5-bugs@MIT.EDU
Date: Mon, 15 Jul 1996 02:34:37 -0400
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>

If you happen to try to use the Kerberos rlogin to try to talk to a system
that isn't running a Kerberos rlogind, the Kerberos rlogin punts and falls
back to the system rlogin.

This works fine.  However, if you're running on a system that uses POSIX
signals (like NetBSD, for example), the signal mask gets inherited to the
child process, and since SIGUSR1 is blocked at this point, it messes up
the window size hack in the system rlogin and the window size doesn't get
propigated to the remote system.

(This isn't just a problem on NetBSD; also see it on Solaris, and I assume
on other systems that use the BSD rlogin).

Appended is a patch that resets the signal mask before exec()'s the system
rlogin.

--Ken

--- krlogin.c.old	Mon Jul 15 02:19:44 1996
+++ krlogin.c	Mon Jul 15 02:24:44 1996
@@ -1558,6 +1558,10 @@
      char **argv;
 {
     register char *host;
+#ifdef POSIX_SIGNALS
+    struct sigaction sa;
+    sigset_t mask;
+#endif
     
 #ifndef KRB5_ATHENA_COMPAT
     if (encrypt_flag)
@@ -1574,7 +1578,12 @@
       host = argv[0];
     if (!strcmp(host, "rlogin"))
       argv++;
-    
+
+#ifdef POSIX_SIGNALS
+    sigemptyset(&mask);
+    sigprocmask(SIG_SETMASK, &mask, NULL);
+#endif
+
     execv(UCB_RLOGIN, argv);
     perror("exec");
     exit(1);

home help back first fref pref prev next nref lref last post