[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Question about telnetd in BusyBox
From:       Wåglund Oskar <oskar.waglund () afry ! com>
Date:       2019-12-09 13:42:01
Message-ID: AM0PR01MB461043D846770A6BA3A840BF91580 () AM0PR01MB4610 ! eurprd01 ! prod ! exchangelabs ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hello everyone!

I have had an issue with inetd/telnetd in BusyBox the past couple of days which I \
can't seem to get around and I was hoping for some friendly advice.

We have recently ported our product to use PetaLinux 2017.3 and with that BusyBox \
(version busybox-1.24.1), and everything has been going very well so far. Now, \
however, our customer has pointed out that sending telnet commands from their test \
framework to our product (which is running the BusyBox telnet daemon) does not work \
in their environment for commands longer than 56 characters. We have observed a \
"weird" behavior that telnetd will split up the echoed response to the client after \
56 characters by adding "whitespace, carriage return" (ASCII 0x20, 0x0D) before \
continuing the output. This is illustrated in the attached WireShark log and \
screenshot. 10.40.241.50 is the telnetd server and 10.40.241.157 is the telnet \
client.

The result of this is that the Telnet client the customer is using in their test \
framework understands the response when the command entered was 56 characters or less \
long, but adds the entered command to the interpreted response when more characters \
are entered:

Connecting...

Sending:
Sending 56 characters aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Received:
-sh: Sending: command not found

Disconnected


Connecting...

Sending:
Sending 57 characters aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Received:
Sending 57 characters aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a
-sh: Sending: command not found

Disconnected

In the WireShark log you can also see that the Telnet negotiation begins with telnetd \
sending DO ECHO, to which the telnet client responds WON'T ECHO and later DON'T ECHO, \
but this has no effect it seems. I can see in a telnetd.c file in BusyBox that this \
seems to be the case, but I don't have the option to recompile the code at the \
moment:

/* Make the telnet client understand we will echo characters so it
                      * should not do it locally. We don't tell the client to run \
                linemode,
                      * because we want to handle line editing and tab completion and \
                other
                      * stuff that requires char-by-char support. */
                      {
                                            static const char iacs_to_send[] ALIGN1 = \
                {
                                                                 IAC, DO, \
                TELOPT_ECHO,
                                                                 IAC, DO, \
                TELOPT_NAWS,
                                                                 /* This requires \
                telnetd.ctrlSQ.patch (incomplete) */
                                                                 /*IAC, DO, \
                TELOPT_LFLOW,*/
                                                                 IAC, WILL, \
                TELOPT_ECHO,
                                                                 IAC, WILL, \
TELOPT_SGA  };

I have also seen a piece of code that seems related to the above mentioned problem \
but haven't been able to connect the dots:

/* We map \r\n ==> \r for pragmatic reasons.
                                                                 * Many client \
                implementations send \r\n when
                                                                 * the user hits the \
                CarriageReturn key.
                                                                 * See RFC 1123 3.3.1 \
                Telnet End-of-Line Convention.
                                                                 */
                                                                 if (c == '\r' && ptr \
                < end && (*ptr == '\n' || *ptr == '\0'))
                                                                                      \
ptr++;  continue;

Now my questions to you are


  1.  Is the added "0x20, 0x0D" a known issue/feature? (Maybe it is not the telnetd \
client adding it after all?)  2.  Is there a way of disabling ECHO in telnetd \
somehow? I have tried desperately to configure this behavior through inetd.cfg and \
inetd.conf but to no avail so far.

I would be most grateful for any advice on this and I would also like to take the \
opportunity to thank you all for the great product that you have produced in BusyBox! \
😊

Best regards
Oskar Wåglund


This e-mail may contain confidential and corporate proprietary information. If \
received in error, kindly notify us immediately and delete the communication from \
your system. Our contacts with you may further involve processing of personal data. \
Please read more about how and why ÅF processes personal data on our website \
www.afconsult.com<http://www.afconsult.com/sv/other-pages/privacy-statement/privacy-statement-for-externals/> \
.


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"Segoe UI Emoji";
	panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle19
	{mso-style-type:personal;
	font-family:"Verdana",sans-serif;
	color:windowtext;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:"Verdana",sans-serif;
	color:#44546A;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:852913956;
	mso-list-type:hybrid;
	mso-list-template-ids:205534516 69009423 69009433 69009435 69009423 69009433 \
69009435 69009423 69009433 69009435;} @list l0:level1
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level2
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level3
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level4
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level5
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level6
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level7
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level8
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level9
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l1
	{mso-list-id:1265655403;
	mso-list-template-ids:-92626744;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">Hello \
everyone!<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">I have had an \
issue with inetd/telnetd in BusyBox the past couple of days which I can't seem to get \
around and I was hoping for some friendly advice.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">We have recently \
ported our product to use PetaLinux 2017.3 and with that BusyBox (version \
busybox-1.24.1), and everything has been going very well so far. Now,  however, our \
customer has pointed out that sending telnet commands from their test framework to \
our product (which is running the BusyBox telnet daemon) does not work in their \
environment for commands longer than 56 characters. We have observed a "weird" \
behavior  that telnetd will split up the echoed response to the client after 56 \
characters by adding "whitespace, carriage return" (ASCII 0x20, 0x0D) before \
continuing the output. This is illustrated in the attached WireShark log and \
screenshot. 10.40.241.50 is the  telnetd server and 10.40.241.157 is the telnet \
client.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">The result of this \
is that the Telnet client the customer is using in their test framework understands \
the response when the command entered was 56 characters or  less long, but adds the \
entered command to the interpreted response when more characters are \
entered:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Connecting...</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Sending:</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Sending 56 characters \
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span></i><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Received:</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">-sh: Sending: command not \
found</span></i><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Disconnected</span></i><i><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p></o:p></span></i></p>
 <p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Connecting...</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Sending:</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Sending 57 characters \
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span></i><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Received:</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Sending 57 characters \
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa </span></i><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">a</span></i><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> \
<p class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">-sh: Sending: command not \
found</span></i><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></i></p> <p \
class="MsoNormal" style="text-autospace:none"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">Disconnected</span></i><i><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p></o:p></span></i></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">In the WireShark \
log you can also see that the Telnet negotiation begins with telnetd sending DO ECHO, \
to which the telnet client responds WON'T ECHO and later  DON'T ECHO, but this has no \
effect it seems. I can see in a telnetd.c file in BusyBox that this seems to be the \
case, but I don't have the option to recompile the code at the \
moment:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">/* Make the telnet \
client understand we will echo characters so it<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* should not do it locally. We don't tell the client to run \
linemode,<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* because we want to handle line editing and tab completion and \
other<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* stuff that requires char-by-char support. */<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
static const char iacs_to_send[] ALIGN1 = {<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span></i><i><span lang="PL" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">IAC, DO, \
TELOPT_ECHO,<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="PL" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
IAC, DO, TELOPT_NAWS,<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span \
lang="PL" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span></i><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">/* This requires \
telnetd.ctrlSQ.patch (incomplete) */<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
/*IAC, DO, TELOPT_LFLOW,*/<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
IAC, WILL, TELOPT_ECHO,<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
IAC, WILL, TELOPT_SGA<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
};<o:p></o:p></span></i></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">I have also seen a \
piece of code that seems related to the above mentioned problem but haven't been able \
to connect the dots:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">/* We map \r\n \
==&gt; \r for pragmatic reasons.<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* Many client implementations send \r\n when<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* the user hits the CarriageReturn key.<o:p></o:p></span></i></p> <p \
class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
* See RFC 1123 3.3.1 Telnet End-of-Line Convention.<o:p></o:p></span></i></p> <p \
<p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if (c == '\r' &amp;&amp; ptr &lt; end &amp;&amp; (*ptr == '\n' || *ptr == \
'\0'))<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ptr&#43;&#43;;<o:p></o:p></span></i></p> <p class="MsoNormal"><i><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
continue;<o:p></o:p></span></i></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">Now my questions \
to you are<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo3"><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">Is \
the added "0x20, 0x0D" a known issue/feature? (Maybe it is not the telnetd client \
adding it after all?)<o:p></o:p></span></li><li class="MsoListParagraph" \
style="margin-left:0cm;mso-list:l0 level1 lfo3"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">Is there a way of \
disabling ECHO in telnetd somehow? I have tried desperately to configure this \
behavior  through inetd.cfg and inetd.conf but to no avail so \
far.<o:p></o:p></span></li></ol> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif">I would be most \
grateful for any advice on this and I would also like to take the opportunity to \
thank you all for the great product that you have produced in BusyBox! </span><span \
lang="EN-US" style="font-size:9.0pt;font-family:&quot;Segoe UI \
Emoji&quot;,sans-serif">&#128522;</span><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p></o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:&quot;Verdana&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><b><span lang="EN-US" \
style="font-size:8.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:black;letter-spacing:.4pt;mso-fareast-language:DE">Best \
regards<o:p></o:p></span></b></p> <p class="MsoNormal"><b><span lang="EN-US" \
style="font-size:8.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:black;letter-spacing:.4pt;mso-fareast-language:DE">Oskar \
Wåglund</span></b><span lang="EN-US" \
style="mso-fareast-language:DE"><o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p>&nbsp;</o:p></span></p> </div>
<p><br>
<span style="font-size: 7pt; color: #838383;">This e-mail may contain confidential \
and corporate proprietary information. If received in error, kindly notify us \
immediately and delete the communication from your system. Our contacts with you may \
further involve  processing of personal data. Please read more about how and why ÅF \
processes personal data on our website <a style="color: #838383;" \
href="http://www.afconsult.com/sv/other-pages/privacy-statement/privacy-statement-for-externals/">
 www.afconsult.com</a> .</span></p>
</body>
</html>


["TelnetTest.png" (image/png)]
["TelnetTest.pcapng" (application/octet-stream)]

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic