From owner-freebsd-bugs Sat Dec 7 08:35:46 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id IAA00417 for bugs-outgoing; Sat, 7 Dec 1996 08:35:46 -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 IAA00407; Sat, 7 Dec 1996 08:35:38 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id DAA31145; Sun, 8 Dec 1996 03:34:50 +1100 Date: Sun, 8 Dec 1996 03:34:50 +1100 From: Bruce Evans Message-Id: <199612071634.DAA31145@godzilla.zeta.org.au> To: freebsd-bugs@freefall.freebsd.org, scrappy@freefall.freebsd.org, uhclem@nemesis.lonestar.org Subject: Re: 2.x telnetd handles CTRL-M differently than other ttys FDIV044 Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Confirmed - this problem still exists in 2.1.5 and 2.2-ALPHA. NO CHANGE. >2.1.6 was not re-tested. > >Additional information: > >The attached program demonstrates the original problem. 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. diff -c2 state.c~ state.c *** state.c~ Mon Sep 23 15:38:17 1996 --- state.c Sun Dec 8 02:05:18 1996 *************** *** 112,115 **** --- 112,150 ---- break; } + #ifdef LINEMODE + /* + * Handle some cases that would otherwise be botched. + */ + if (linemode) { + /* + * Convert CR to NL in the -ICANON ICRNL + * case. This case can also be fixed by + * changing isbinary() to fail if ICRNL + * is set. Then we never get here. This + * fix seems reasonably since we don't + * have pure binary if we're converting + * CR's. However, it breaks ISTRIP (by + * forcing -ISTRIP). + */ + if (c == '\r') { + if (tty_israw() && tty_iscrnl()) + c = '\n'; + *pfrontp++ = c; + break; + } + /* + * XXX missing: IGNCR, INLCR. These also + * stop binary mode from being pure, but + * checking them in isbinary() doesn't help. + * + * XXX broken: IEXTEN. Turning it off has + * no effect on the things that it is supposed + * to control. + * + * We don't really understand termio[s]. + */ + } + #endif + /* * We now map \r\n ==> \r for pragmatic reasons. >A related problem: (there should be an open PR on this but I don't see it) > >1. Login to stock shell with stock .cshrc/.login (csh with filec > enabled) >2. cd directory where above programs reside. >3. Type [c][CTRL][D] > system should display files that match, including chars.c. NORMAL >4. [CTRL][C]. >5. Telnet self >6. login (same csh/filec login used in steps 1-5) >7. cd directory where above programs reside. >8. Type [c][CTRL][D] > system should display files that match, but instead, simply > echos ^D. MALFUNCTION >As above, replacing telnetd with the one shipped with 1.1.5.1 fixes >this problem. Still broken. Bruce