[2939] in Kerberos-V5-bugs

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

telnet/607: telnetd workaround for IRIX bug

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Sat Jun 6 11:31:50 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: hartmans@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, ghudson@MIT.EDU
Date: Sat, 6 Jun 1998 11:25:02 -0400
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU


>Number:         607
>Category:       telnet
>Synopsis:       IRIX TIOCPKT handling is buggy; telnetd output gets eaten
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hartmans
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Sat Jun 06 11:26:01 EDT 1998
>Last-Modified:
>Originator:     Greg Hudson
>Organization:
MIT
>Release:        1.0pl1
>Environment:
	
System: SunOS small-gods.mit.edu 5.6 Generic_105181-04 sun4u sparc SUNW,Ultra-1
Architecture: sun4

>Description:
When you telnet to an IRIX machine running the krb5 telnetd, sometimes the
first character of output gets eaten.  The cause of this is a bug in IRIX's
packet-mode support for ptys: if output has already been generated when you
turn on packet mode, it doesn't present that output in packet mode, so the
first byte of output gets interpreted as a status byte.
>How-To-Repeat:
>Fix:
This is a pretty simple-minded fix to turn on packet mode before the slave
process starts (and thus before any output can be generated).  There may be
something cleaner, but it isn't easy to see any method behind the madness
of the telnetd code.

Index: telnetd.c
===================================================================
RCS file: /afs/dev.mit.edu/source/repository/third/krb5/src/appl/telnet/telnetd/telnetd.c,v
retrieving revision 1.4
diff -c -r1.4 telnetd.c
*** telnetd.c	1998/02/01 18:36:13	1.4
--- telnetd.c	1998/06/06 15:12:21
***************
*** 904,909 ****
--- 904,910 ----
  	struct hostent *hp;
  	int level;
  	int ptynum;
+ 	int on = 1;
  	char user_name[256];
  long retval;
  	/*
***************
*** 995,1000 ****
--- 996,1008 ----
  	 * Start up the login process on the slave side of the terminal
  	 */
  #ifndef	convex
+ #ifndef	STREAMSPTY
+ 	/*
+ 	 * Turn on packet mode
+ 	 */
+ 	(void) ioctl(pty, TIOCPKT, (char *)&on);
+ #endif
+ 
  	startslave(host, level, user_name);
  
  #if	defined(_SC_CRAY_SECURE_SYS)
***************
*** 1149,1161 ****
  
  	if (my_state_is_wont(TELOPT_ECHO))
  		send_will(TELOPT_ECHO, 1);
- 
- #ifndef	STREAMSPTY
- 	/*
- 	 * Turn on packet mode
- 	 */
- 	(void) ioctl(p, TIOCPKT, (char *)&on);
- #endif
  
  #if	defined(LINEMODE) && defined(KLUDGELINEMODE)
  	/*
--- 1157,1162 ----
>Audit-Trail:
>Unformatted:

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