Date: Sun, 11 Jun 1995 19:40:02 -0700 From: Charles Henrich <henrich@crh.cl.msu.edu> To: freebsd-bugs Subject: bin/505: LINEMODE causes problems with some telnetd clients + fix. Message-ID: <199506120240.TAA15991@freefall.cdrom.com> In-Reply-To: Your message of Sun, 11 Jun 1995 22:34:14 -0400 <199506120234.WAA05116@crh.cl.msu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
>Number: 505 >Category: bin >Synopsis: LINEMODE causes problems with some telnetd clients + fix. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 11 19:40:01 1995 >Originator: Charles Henrich >Organization: Michigan State U. >Release: FreeBSD 2.0-BUILT-19950603 i386 >Environment: FreeBSD 2.0.5-R >Description: The final negotiation of DO_BINARY in the LINEMODE portion of the telnetd code causes some clients that do not support linemode to mis-interpret the return key (i.e. double returns). >How-To-Repeat: Use FTP Software PCTCP or NCSA Telnet and telnet to a freebsd box. >Fix: *** termstat.c.orig Mon Dec 21 08:09:29 1987 --- termstat.c Mon Dec 21 08:18:20 1987 *************** *** 144,168 **** #endif /* defined(CRAY2) && defined(UNICOS5) */ /* - * Check for state of BINARY options. - */ - if (tty_isbinaryin()) { - if (his_want_state_is_wont(TELOPT_BINARY)) - send_do(TELOPT_BINARY, 1); - } else { - if (his_want_state_is_will(TELOPT_BINARY)) - send_dont(TELOPT_BINARY, 1); - } - - if (tty_isbinaryout()) { - if (my_want_state_is_wont(TELOPT_BINARY)) - send_will(TELOPT_BINARY, 1); - } else { - if (my_want_state_is_will(TELOPT_BINARY)) - send_wont(TELOPT_BINARY, 1); - } - - /* * Check for changes to flow control if client supports it. */ flowstat(); --- 144,149 ---- *************** *** 181,186 **** --- 162,195 ---- tty_setlinemode(uselinemode); } + if(uselinemode) { + + /* + * Check for state of BINARY options. + * + * We only need to do the binary dance if we are actually going + * to use linemode. As this confuses some telnet clients that dont + * support linemode, and doesnt gain us anything, we dont do it + * unless we're doing linemode. -Crh (henrich@msu.edu) + */ + + if (tty_isbinaryin()) { + if (his_want_state_is_wont(TELOPT_BINARY)) + send_do(TELOPT_BINARY, 1); + } else { + if (his_want_state_is_will(TELOPT_BINARY)) + send_dont(TELOPT_BINARY, 1); + } + + if (tty_isbinaryout()) { + if (my_want_state_is_wont(TELOPT_BINARY)) + send_will(TELOPT_BINARY, 1); + } else { + if (my_want_state_is_will(TELOPT_BINARY)) + send_wont(TELOPT_BINARY, 1); + } + + } /* * Do echo mode handling as soon as we know what the >Audit-Trail: >Unformatted: To: FreeBSD-gnats-submit@freebsd.org Subject: LINEMODE causes problems with some telnetd clients + fix. From: henrich@crh.cl.msu.edu Reply-To: henrich@crh.cl.msu.edu X-send-pr-version: 3.2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506120240.TAA15991>