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). The fix is to only do the state check for binary options if linemode will be used. Closes PR#505. Submitted by: Charles Henrich Obtained from: FreeBSD insecure telnetd
This commit is contained in:
parent
9809ff32f6
commit
4fd39f708a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9591
@ -143,25 +143,6 @@ localstat()
|
|||||||
newmap = tty_isnewmap();
|
newmap = tty_isnewmap();
|
||||||
#endif /* defined(CRAY2) && defined(UNICOS5) */
|
#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.
|
* Check for changes to flow control if client supports it.
|
||||||
*/
|
*/
|
||||||
@ -181,6 +162,34 @@ localstat()
|
|||||||
tty_setlinemode(uselinemode);
|
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 don't support linemode, and doesn't gain us
|
||||||
|
* anything, we don't 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENCRYPTION
|
#ifdef ENCRYPTION
|
||||||
/*
|
/*
|
||||||
* If the terminal is not echoing, but editing is enabled,
|
* If the terminal is not echoing, but editing is enabled,
|
||||||
|
@ -143,25 +143,6 @@ localstat()
|
|||||||
newmap = tty_isnewmap();
|
newmap = tty_isnewmap();
|
||||||
#endif /* defined(CRAY2) && defined(UNICOS5) */
|
#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.
|
* Check for changes to flow control if client supports it.
|
||||||
*/
|
*/
|
||||||
@ -181,6 +162,34 @@ localstat()
|
|||||||
tty_setlinemode(uselinemode);
|
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 don't support linemode, and doesn't gain us
|
||||||
|
* anything, we don't 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENCRYPTION
|
#ifdef ENCRYPTION
|
||||||
/*
|
/*
|
||||||
* If the terminal is not echoing, but editing is enabled,
|
* If the terminal is not echoing, but editing is enabled,
|
||||||
|
Loading…
Reference in New Issue
Block a user