[PATCH] telnetd: Added support for AYT IAC command.

Martin Lewis martin.lewis.x84 at gmail.com
Tue Apr 9 10:36:42 UTC 2019


You're absolutely right, I'll fix this right away.

On Thu, 4 Apr 2019 at 15:46, Denys Vlasenko <vda.linux at googlemail.com>
wrote:

> On Thu, Apr 4, 2019 at 1:33 PM Martin Lewis <martin.lewis.x84 at gmail.com>
> wrote:
> >
> > Fixed a TODO in AYT IAC handling by replying back with a NOP.
> >
> > Signed-off-by: Martin Lewis <martin.lewis.x84 at gmail.com>
> > ---
> >  networking/telnetd.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/networking/telnetd.c b/networking/telnetd.c
> > index caef151..c6fe815 100644
> > --- a/networking/telnetd.c
> > +++ b/networking/telnetd.c
> > @@ -249,7 +249,7 @@ safe_write_to_pty_decode_iac(struct tsession *ts)
> >          * IAC SE  (240) End of subnegotiation. Treated as NOP.
> >          * IAC NOP (241) NOP. Supported.
> >          * IAC BRK (243) Break. Like serial line break. TODO via
> tcsendbreak()?
> > -        * IAC AYT (246) Are you there. Send back evidence that AYT was
> seen. TODO (send NOP back)?
> > +        * IAC AYT (246) Are you there.
> >          *  These don't look useful:
> >          * IAC DM  (242) Data mark. What is this?
> >          * IAC IP  (244) Suspend, interrupt or abort the process.
> (Ancient cousin of ^C).
> > @@ -277,6 +277,12 @@ safe_write_to_pty_decode_iac(struct tsession *ts)
> >                 rc = 2;
> >                 goto update_and_return;
> >         }
> > +       if (buf[1] == AYT) {
> > +               /* Send back evidence that AYT was seen. */
> > +               buf[1] = NOP;
> > +               rc = safe_write(ts->sockfd_write, buf, 2);
> > +               goto update_and_return;
>
> what if rc == -1 now?
>
> > +       }
> >         if (buf[1] >= 240 && buf[1] <= 249) {
> >                 /* NOP (241). Ignore (putty keepalive, etc) */
> >                 /* All other 2-byte commands also treated as NOPs here */
> > --
> > 1.9.1
> >
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://lists.busybox.net/mailman/listinfo/busybox
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20190409/cb7ed9cc/attachment.html>


More information about the busybox mailing list