Date: Sun, 8 Dec 1996 03:34:50 +1100 From: Bruce Evans <bde@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 Message-ID: <199612071634.DAA31145@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612071634.DAA31145>