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:[EMAIL PROTECTED] 
Sent: Monday, November 10, 2008 5:52 PM
To: Cathey, Jim
Cc: [email protected]
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

Attachment: telnet.patch
Description: telnet.patch

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to