From henrich@crh.cl.msu.edu  Sun Jun 11 19:33:27 1995
Received: from crh.cl.msu.edu (crh.cl.msu.edu [35.8.1.24])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id TAA15482
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 11 Jun 1995 19:33:26 -0700
Received: (from henrich@localhost) by crh.cl.msu.edu (8.6.11/8.6.9) id WAA05116 for FreeBSD-gnats-submit@freebsd.org; Sun, 11 Jun 1995 22:34:14 -0400
Message-Id: <199506120234.WAA05116@crh.cl.msu.edu>
Date: Sun, 11 Jun 1995 22:34:14 -0400
From: Charles Henrich <henrich@crh.cl.msu.edu>
To: FreeBSD-gnats-submit@freebsd.org
Subject: LINEMODE causes problems with some telnetd clients + fix.

>Number:         505
>Category:       bin
>Synopsis:       LINEMODE causes problems with some telnetd clients + fix.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 11 19:40:01 1995
>Closed-Date:    Fri Jun 16 22:50:54 PDT 1995
>Last-Modified:
>Originator:     Charles Henrich
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
Michigan State U.
>Environment:

FreeBSD 2.0.5-R
	

>Description:

The final negotiation of DO_BINARY in the LINEMODE portion of the telnetd code
causes some clients that do not support linemode to mis-interpret the return
key (i.e. double returns).
	

>How-To-Repeat:

Use FTP Software PCTCP or NCSA Telnet and telnet to a freebsd box.
	

>Fix:
	
	

*** termstat.c.orig	Mon Dec 21 08:09:29 1987
--- termstat.c	Mon Dec 21 08:18:20 1987
***************
*** 144,168 ****
  #endif	/* defined(CRAY2) && defined(UNICOS5) */
  
  	/*
- 	 * Check for state of BINARY options.
- 	 */
- 	if (tty_isbinaryin()) {
- 		if (his_want_state_is_wont(TELOPT_BINARY))
- 			send_do(TELOPT_BINARY, 1);
- 	} else {
- 		if (his_want_state_is_will(TELOPT_BINARY))
- 			send_dont(TELOPT_BINARY, 1);
- 	}
- 
- 	if (tty_isbinaryout()) {
- 		if (my_want_state_is_wont(TELOPT_BINARY))
- 			send_will(TELOPT_BINARY, 1);
- 	} else {
- 		if (my_want_state_is_will(TELOPT_BINARY))
- 			send_wont(TELOPT_BINARY, 1);
- 	}
- 
- 	/*
  	 * Check for changes to flow control if client supports it.
  	 */
  	flowstat();
--- 144,149 ----
***************
*** 181,186 ****
--- 162,195 ----
  		tty_setlinemode(uselinemode);
  	}
  
+         if(uselinemode) { 
+ 
+             /*
+              * Check for state of BINARY options.
+              *
+              * We only need to do the binary dance if we are actually going
+              * to use linemode.  As this confuses some telnet clients that dont
+              * support linemode, and doesnt gain us anything, we dont do it 
+              * unless we're doing linemode.  -Crh (henrich@msu.edu)
+              */
+ 
+ 	    if (tty_isbinaryin()) {
+ 		    if (his_want_state_is_wont(TELOPT_BINARY))
+ 			    send_do(TELOPT_BINARY, 1);
+ 	    } else {
+ 		    if (his_want_state_is_will(TELOPT_BINARY))
+ 			    send_dont(TELOPT_BINARY, 1);
+ 	    }
+     
+ 	    if (tty_isbinaryout()) {
+ 		    if (my_want_state_is_wont(TELOPT_BINARY))
+ 			    send_will(TELOPT_BINARY, 1);
+ 	    } else {
+ 		    if (my_want_state_is_will(TELOPT_BINARY))
+ 			    send_wont(TELOPT_BINARY, 1);
+ 	    }
+ 
+         }
  
  	/*
  	 * Do echo mode handling as soon as we know what the

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: davidg 
State-Changed-When: Fri Jun 16 22:50:54 PDT 1995 
State-Changed-Why:  
Suggested patch was applied. 
>Unformatted:


To: FreeBSD-gnats-submit@freebsd.org
Subject: LINEMODE causes problems with some telnetd clients + fix.
From: henrich@crh.cl.msu.edu
Reply-To: henrich@crh.cl.msu.edu
X-send-pr-version: 3.2


