From owner-freebsd-bugs Sat Dec 7 21:26:19 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id VAA27064 for bugs-outgoing; Sat, 7 Dec 1996 21:26:19 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id VAA27055; Sat, 7 Dec 1996 21:26:03 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id QAA15524; Sun, 8 Dec 1996 16:16:28 +1100 Date: Sun, 8 Dec 1996 16:16:28 +1100 From: Bruce Evans Message-Id: <199612080516.QAA15524@godzilla.zeta.org.au> To: bde@zeta.org.au, j@uriah.heep.sax.de Subject: Re: 2.x telnetd handles CTRL-M differently than other ttys FDIV044 Cc: freebsd-bugs@freefall.freebsd.org, scrappy@freefall.freebsd.org, uhclem@nemesis.lonestar.org Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> Here is a half baked fix for the problem demonstrated by the program. >> ICRNL works now. Unusual settings like INLCR and IGNCR are still broken. > >I think that's the wrong approach. According to my tcpdump, and to >the RFCs, the mere problem is that the telnet client sends \r only >where the RFC requires it to send \r\n if LINE and EDIT modes are >turned on. telnetd seems to rely on this, and only converts \r\n back >to the local EOL character, but not a sole \r as it is sent by >FreeBSD's telnet client. But EDIT mode isn't turned on. The program is in icanon (cbreak) mode. \r\n is sent correctly in EDIT mode. \r and \n have to be handled separately in icanon mode for termios semantics to work. telnetd was already careful not to translate \r\n except in "CRMOD" mode. It does the translation only if the mode is !inbinary && icrnl. This has a chance of working for sgttyb but no chance for termios. There are about 2^8 times as many combinations of the the flags for termios, and even the usual ones don't map very well to telnet modes. Bruce