outstanding telnetd bug fix, and two new features

Denys Vlasenko vda.linux at googlemail.com
Tue Nov 11 01:51:57 UTC 2008


On Tuesday 11 November 2008 00:59, Cathey, Jim wrote:
> >Patch deletes this [FIXME] comment
> >without ever explaining why, or including
> >a fix. Do we handle sending of 0xff, or not?
> >If not, why do you delete the comment?
> 
> The patch deletes the FIXME comment, because the patch
> fixes the problem!  The escape character for IAC is IAC,
> hence the IAC-IAC being turned into a single literal 0xFF.
> The first string of '-' markers in the patch file deletes
> the comment, the first string of '+' markers fixes the bug.

The patch handles RECEIVED IAC-IAC sequence.
FIXME comment is about SENDING a character with code 0xff.
As in "what if program which talks to the user
over telnet connection will do putchar(0xff)?"


Example: on my machine I have locale in which
every glyph is one characher. Including 0xff.
This is what I can do in my xterm:

Make program sent me an 0xff:

bash-3.2# echo $'\xff'
Ъ

Send 0xff to a program as input:

bash-3.2# echo -n 'Ъ' | hexdump -vC
00000000  ff                                                |.|
00000001


Now, in busybox telnetd, it does not work right:

shadow:~# echo $'\xff'
(nothing!)
shadow:~# echo $'\xff\xff\xff\xff'
ЪЪ (instead of four, only two)

the above was output, and input doesn't work at all -
ad attempt to type or paste character 0xff as part of
shell input simply fails, nothing is echoed back.

0xfe works:

shadow:~# echo -n 'Ч' | hexdump -vC
00000000  fe                                                |.|
00000001


Home it's clearer now.
--
vda



More information about the busybox mailing list