[2894] in Kerberos-V5-bugs

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

pending/562: PATCH: telnetd/klogind IRIX/AIX

daemon@ATHENA.MIT.EDU (Larry Schwimmer)
Tue Mar 17 22:14:08 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: gnats-admin@rt-11.MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU,
        Larry Schwimmer <schwim@whatmore.Stanford.EDU>
Date: Tue, 17 Mar 1998 19:13:38 -0800 (PST)
From: Larry Schwimmer <schwim@whatmore.Stanford.EDU>
To: krb5-bugs@MIT.EDU
Cc: schwim@leland.Stanford.EDU


>Number:         562
>Category:       pending
>Synopsis:       PATCH: telnetd/klogind IRIX/AIX
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Mar 17 22:14:01 EST 1998
>Last-Modified:
>Originator:
>Organization:
>Release:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted:
Submitter-Id:	net
Originator:	Larry Schwimmer
Confidential:	no
Synopsis:	AIX and IRIX should not use packet mode
Severity:	serious
Priority:	medium
Category:	sw-bug
Class:		krb5-clients
Release:	1.0.5
Environment:	IRIX, AIX
Description:

	telnetd and klogind do not work properly under IRIX and AIX
if packet mode is used.

How-To-Repeat:

	Use the unmodified telnetd and klogind on IRIX or AIX.  The
terminal misdisplays output for some programs.  (For example, the pine
mail program is unusable on IRIX without this patch.)

Fix:

	Most of these two patches involve disabling the code for the
TIOCPKT ioctl for AIX and IRIX.  The remainder could be cleaner, but
it points out what works.

			yours,
				Larry Schwimmer
				schwim@leland.stanford.edu
				Leland Systems Group


--- appl/bsd/krlogind.c.orig	Fri Feb  6 19:41:17 1998
+++ appl/bsd/krlogind.c	Mon Mar 16 17:25:40 1998
@@ -861,8 +938,8 @@
     register tiocpkt_on = 0;
     int on = 1;
 #endif
-    
-#if defined(TIOCPKT) && !defined(__svr4__) || defined(solaris20)
+
+#if (defined(TIOCPKT) && !defined(__svr4__) && !defined(sgi)) || defined(solaris20)
     /* if system has TIOCPKT, try to turn it on. Some drivers
      * may not support it. Save flag for later. 
      */
--- appl/telnet/telnetd/telnetd.c.orig	Fri Feb  6 19:41:48 1998
+++ appl/telnet/telnetd/telnetd.c	Tue Mar 17 03:06:22 1998
@@ -1113,12 +1133,14 @@
 	if (my_state_is_wont(TELOPT_ECHO))
 		send_will(TELOPT_ECHO, 1);
 
+#if !defined(_AIX) && !defined(sgi)
 #ifndef	STREAMSPTY
 	/*
 	 * Turn on packet mode
 	 */
 	(void) ioctl(p, TIOCPKT, (char *)&on);
 #endif
+#endif
 
 #if	defined(LINEMODE) && defined(KLUDGELINEMODE)
 	/*
@@ -1370,6 +1392,20 @@
 #else
 			pcc = readstream(p, ptyibuf, BUFSIZ);
 #endif
+#if defined(_AIX) || defined(sgi)
+			if (pcc < 0 && (errno == EWOULDBLOCK ||
+#ifdef EAGAIN
+					errno == EAGAIN ||
+#endif
+					errno == EIO)) {
+				pcc = 0;
+			} else {
+				if (pcc <= 0)
+					break;
+				ptyip = ptyibuf;
+			}
+		}
+#else /* ! _AIX && !sgi */
 			/*
 			 * On some systems, if we try to read something
 			 * off the master side before the slave side is
@@ -1439,6 +1475,7 @@
 #endif	/* defined(CRAY2) && defined(UNICOS5) */
 			}
 		}
+#endif /* _AIX && sgi */
 
 		while (pcc > 0) {
 			if ((&netobuf[BUFSIZ] - nfrontp) < 2)

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