outstanding telnetd bug fix, and two new features
Cathey, Jim
jcathey at ciena.com
Tue Nov 11 16:00:11 PST 2008
OK, I have tried out a new version of telnetd.c that
contains all the patches we've used before (including
the one you don't like), and also adds an add_iacs()
function to take care of escaping literal 0xFF characters
going the other way. Herewith is the diff -u patch.
Seemed to work for me, and even preserves the existing
bug structure of the semi-circular buffers in telnetd.
-- Jim
-----Original Message-----
From: Denys Vlasenko [mailto:vda.linux at googlemail.com]
Sent: Monday, November 10, 2008 5:52 PM
To: Cathey, Jim
Cc: busybox at busybox.net
Subject: Re: outstanding telnetd bug fix, and two new features
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: telnet.patch
Type: application/octet-stream
Size: 6435 bytes
Desc: telnet.patch
Url : http://busybox.net/lists/busybox/attachments/20081111/f7268c08/attachment.obj
More information about the busybox
mailing list