[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Extra null bytes appearing in telnetd

From: Byron Stanoszek
Subject: Re: [bug-inetutils] Extra null bytes appearing in telnetd
Date: Fri, 1 Jun 2007 15:47:18 -0400 (EDT)

On Sat, 19 May 2007, Alfred M. Szmidt wrote:

  On Linux, I've noticed lately that each output buffer transmitted
  by telnetd to the client is preceded by a null byte. This might be
  something specific to the Linux pty device or termio settings, but
  I don't know as I've not been able to test on other OSes.

When you speak of the operating system that is basically the GNU
system with Linux added, would you please call it "GNU/Linux"?  If you
call it just "Linux", you're giving the principal developers none of
the credit.

Will do next time. I was more referring to Linux as the kernel anyway, wrt its
pty/termio implementation.

  During large transmissions such as an 'ls -l' command, these null
  bytes appear randomly througout the transmission. Sometimes they
  appear in the middle of an ANSI escape sequence, thereby causing
  different colors or extra characters to show on the client. The
  telnetd from the netkit package does not have this problem.

I have never experienced this behaviour, even when listing big files
using cat.  What is a `large transmission' in kilobytes?  Have you
tried this over different speeds?  Does it only happen during ls?

Clearly, if this happens, it is a bug, but it would be good to know
exactly under what conditions it happens.  Your patch seems a bit iffy
just disgarding input like that, but that is most probobly that I
haven't looked at the code for telnetd in ages.  But if it works on
GNU systems, it will/should work on other systems as well.

Basically each and every output buffer received over the pty from the kernel
side was copied over to the client with a null byte prefixing the message.
While doing a strace on telnetd and then typing any command like 'ls' in the
telnet window, I noticed that telnetd would read from the pty buffer in chunks
of about 1400 bytes and send them onto the client one after another. Each chunk
sent to the client would be 1 byte larger always with an extra null byte at the

I don't know if this is Linux (kernel) specific, i.e. whether Linux is
inserting an extra null byte in the pty message or if it's just a bug in
telnetd. Again, I don't have other OSes handy at the moment to test this
against and was wondering if anyone else saw similar issues.

If you have a terminal program that displays null bytes as actual characters on
the screen, then you can see the problem almost immediately. I also notice that
sometimes during login, 01h characters appear on the screen in place of the
telnet commands that turn TELOPT_ECHO on and off. The patch I posted earlier
fixes all of these issues, but I don't know if it's the right thing to do on
other OSes.


Byron Stanoszek                         Ph: (330) 644-3059
Systems Programmer                      Fax: (330) 644-8110
Commercial Timesharing Inc.             Email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]