From owner-freebsd-bugs Tue Oct 10 11:21:39 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA28726 for bugs-outgoing; Tue, 10 Oct 1995 11:21:39 -0700 Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id LAA28721 for ; Tue, 10 Oct 1995 11:21:36 -0700 Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA10316; Tue, 10 Oct 1995 14:20:57 -0400 Date: Tue, 10 Oct 1995 14:20:57 -0400 From: "Garrett A. Wollman" Message-Id: <9510101820.AA10316@halloran-eldar.lcs.mit.edu> To: Bill Fenner Cc: uhclem%nemesis@fw.ast.com (Frank Durda IV), freebsd-bugs@freefall.freebsd.org Subject: Re: bin/771: telnet - FDIV035 In-Reply-To: <95Oct10.090037pdt.177475@crevenia.parc.xerox.com> References: <199510100130.SAA00868@freefall.freebsd.org> <95Oct10.090037pdt.177475@crevenia.parc.xerox.com> Sender: owner-bugs@FreeBSD.org Precedence: bulk < said: > Using a -stable sup'd on saturday, I can telnet to myself and duplicate > Frank's problem #2 (related to control-D). It doesn't happen when connecting > from -stable to a SunOS 4.1.3 box. I have now managed to reproduce this problem. It seems to be a fundamental incompatibility between the expectations of the shell and the way TELNET's LINEMODE option works. The problem is this: LINEMODE has to submodes in which it can operate. One of these is EDIT|TRAPSIG, and is equivalent to the tty driver's ICANON mode. The second is plain TRAPSIG, which works like ISIG mode in the tty driver. However, there is a subtle difference: the tty driver's ISIG mode only interprets the VINTR [IP], VQUIT [ABORT], and VSUSP [SUSPEND] characters. However, LINEMODE's TRAPSIG submode interprets all of the control characters, including (most significantly for our purposes) VEOF [EOF]. This causes the shell to get an end-of-file indication when you type ^D, rather than the ^D character that it was expecting. There are two possible fixes for this problem: 1) Only use LINEMODE to implement ICANON. 2) When switching between EDIT|TRAPSIG and plain TRAPSIG modes (or between ICANON and ISIG or ISIG|IEXTEN in the equivalent TTY driver terms), telnetd must negotiate to have those special characters disabled which would not have been implemented by the TTY driver in that mode. I prefer option (2). Unfortunately, I don't know Dave Borman's current address to ask his opinion... -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant