EOL in stderr of ssh - Linux

Damien Miller djm at mindrot.org
Wed Jul 16 20:09:57 EST 2008


On Mon, 14 Jul 2008, Stanislaw Kaminski wrote:

> Hello everyone,
> recently I've found something I consider a bug.
> 
> Correct me if I'm wrong, but I always thought that Linux' EOL is 0x0A.
> Imagine my surprise when I saw that all messages that are being output
> on to the stderr (on any Linux I've tested - Fedora and Ubuntu) are
> terminated with 0x0D, 0x0A.
> 
> Maybe that's standard behaviour of all stderr messages in all Linux
> software, but I have to admin it's the first time I saw something like
> this.
> 
> So, can anybody tell me if it's for a purpose, or is it just a plain bug?

stderr logging is terminated with \r\n in case (IIRC) the terminal is
in raw mode to prevent stair-stepping of text - e.g.

debug1: SSH2_MSG_KEXINIT sent
                             debug1: rekeying in progress
                                                         debug1: rekeying in progress

... and so forth. I'm not sure why it doesn't appear in the output earlier -
perhaps cooked terminal mode eats the \r's

The actual code is in log.c.

-d



More information about the openssh-unix-dev mailing list