🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #535

4.3BSD Telnetd incorrectly maps CR-LF sequences

#535
From: robert
Date: Thu, 29 Jan 1987 15:40
51 lines
2240 bytes
Index:
	/usr/src/etc/telnetd.c 4.3BSD

Description:
	The version of telnetd as delivered in 4.3BSD incorrectly maps
	CR-LF sequences received over the network on to LF's which are
	then handed on to the pty driver.

	This goes unnoticed most of the time because the tty driver
	accepts either CR or LF as end-of-line characters when in
	cooked mode.  However, it means that any program operating in
	cbreak mode, which is invoked over a telnet connection,
	mysteriously fails.  This includes tip, telnet itself and
	probably others.

	(Has no-one noticed this before now ?)

Fix:
	The fix is, fortunately, a one-liner. CR-LF sequences should
	be mapped on to CR's, not LF's. Apply the following patch
	(Note that the correct version is now between the #ifdef lines).


*** /usr/src/etc/telnetd.c	Thu Dec  4 10:16:23 1986
--- /usr/src/etc/telnetd.c.ucb	Tue May 13 07:21:51 1986
***************
*** 637,647 ****
  			if ((myopts[TELOPT_BINARY] == OPT_NO) && c == '\r') {
  				if ((ncc > 0) && ('\n' == *netip)) {
  					netip++; ncc--;
- #ifdef HASLER
- 					c = '\r';
- #else
  					c = '\n';
- #endif
  				} else {
  					state = TS_CR;
  				}
--- 637,643 ----


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    J. Robert Ward,						   ___________
    Hasler AG, Belpstrasse 23, CH-3000 Berne 14, Switzerland	   |    _    |
								   |  _| |_  |
Tel.:	    +41 31 632319					   | |_   _| |
X.400:	    robert@hslrswi.hasler				   |   |_|   |
Bitnet:	    robert%hslrswi.UUCP@cernvax.BITNET	   		   |_________|
Uucp:	    ... {seismo,ukc, ... }!mcvax!cernvax!hslrswi!robert
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID: <422@hslrswi.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!mcvax!cernvax!hslrswi!robert

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!mcvax!cernvax!hslrswi!robert
From: robert@hslrswi.UUCP
Newsgroups: comp.bugs.4bsd
Subject: 4.3BSD Telnetd incorrectly maps CR-LF sequences
Message-ID: <422@hslrswi.UUCP>
Date: Thu, 29-Jan-87 10:40:27 EST
Article-I.D.: hslrswi.422
Posted: Thu Jan 29 10:40:27 1987
Date-Received: Sat, 31-Jan-87 20:21:44 EST
Organization: Hasler AG, Berne, Switzerland
Lines: 51
Keywords: telnet telnetd 4.3BSD