diff options
author | Martin Lewis <martin.lewis.x84@gmail.com> | 2019-04-04 13:29:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-04-04 15:44:36 +0200 |
commit | 93594b1197cf3ae1835eedebbebb2b40ea2a81f7 (patch) | |
tree | 91b80f68146a4800fee16e3fa91963ef7b838a1b | |
parent | 2b6282117f026cfa2a3e7efee7caa054b6265264 (diff) | |
download | busybox-w32-93594b1197cf3ae1835eedebbebb2b40ea2a81f7.tar.gz busybox-w32-93594b1197cf3ae1835eedebbebb2b40ea2a81f7.tar.bz2 busybox-w32-93594b1197cf3ae1835eedebbebb2b40ea2a81f7.zip |
telnetd: Added support for AYT IAC command.
Fixed a TODO in AYT IAC handling by replying back with a NOP.
Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/telnetd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index caef15181..bd60c8681 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -249,7 +249,7 @@ safe_write_to_pty_decode_iac(struct tsession *ts) | |||
249 | * IAC SE (240) End of subnegotiation. Treated as NOP. | 249 | * IAC SE (240) End of subnegotiation. Treated as NOP. |
250 | * IAC NOP (241) NOP. Supported. | 250 | * IAC NOP (241) NOP. Supported. |
251 | * IAC BRK (243) Break. Like serial line break. TODO via tcsendbreak()? | 251 | * IAC BRK (243) Break. Like serial line break. TODO via tcsendbreak()? |
252 | * IAC AYT (246) Are you there. Send back evidence that AYT was seen. TODO (send NOP back)? | 252 | * IAC AYT (246) Are you there. |
253 | * These don't look useful: | 253 | * These don't look useful: |
254 | * IAC DM (242) Data mark. What is this? | 254 | * IAC DM (242) Data mark. What is this? |
255 | * IAC IP (244) Suspend, interrupt or abort the process. (Ancient cousin of ^C). | 255 | * IAC IP (244) Suspend, interrupt or abort the process. (Ancient cousin of ^C). |
@@ -277,6 +277,13 @@ safe_write_to_pty_decode_iac(struct tsession *ts) | |||
277 | rc = 2; | 277 | rc = 2; |
278 | goto update_and_return; | 278 | goto update_and_return; |
279 | } | 279 | } |
280 | if (buf[1] == AYT) { | ||
281 | /* Send back evidence that AYT was seen. */ | ||
282 | buf[1] = NOP; | ||
283 | /*rc =*/ safe_write(ts->sockfd_write, buf, 2); | ||
284 | rc = 2; | ||
285 | goto update_and_return; | ||
286 | } | ||
280 | if (buf[1] >= 240 && buf[1] <= 249) { | 287 | if (buf[1] >= 240 && buf[1] <= 249) { |
281 | /* NOP (241). Ignore (putty keepalive, etc) */ | 288 | /* NOP (241). Ignore (putty keepalive, etc) */ |
282 | /* All other 2-byte commands also treated as NOPs here */ | 289 | /* All other 2-byte commands also treated as NOPs here */ |