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? yours sincerely, Stanislaw Kaminski
On Mon, Jul 14, 2008 at 04:26:47PM +0200, Stanislaw Kaminski wrote:> 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.How are you testing this?> So, can anybody tell me if it's for a purpose, or is it just a plain bug?I doubt ssh has \r\n in any source files. //Peter
Not on my Fedora Core 7 or my CentOS 5.2 box - both of them terminate with just 0x0A, as is shown below: ssh -v 2>&1 | xxd 0000000: 4f70 656e 5353 485f 342e 3370 322c 204f OpenSSH_4.3p2, O 0000010: 7065 6e53 534c 2030 2e39 2e38 6220 3034 penSSL 0.9.8b 04 0000020: 204d 6179 2032 3030 360a 7573 6167 653a May 2006.usage: 0000030: 2073 7368 205b 2d31 3234 3641 6143 6667 ssh [-1246AaCfg 0000040: 6b4d 4e6e 7173 5474 5676 5878 595d 205b kMNnqsTtVvXxY] [ 0000050: 2d62 2062 696e 645f 6164 6472 6573 735d -b bind_address] 0000060: 205b 2d63 2063 6970 6865 725f 7370 6563 [-c cipher_spec 0000070: 5d0a 2020 2020 2020 2020 2020 205b 2d44 ]. [-D 0000080: 205b 6269 6e64 5f61 6464 7265 7373 3a5d [bind_address:] 0000090: 706f 7274 5d20 5b2d 6520 6573 6361 7065 port] [-e escape 00000a0: 5f63 6861 725d 205b 2d46 2063 6f6e 6669 _char] [-F confi 00000b0: 6766 696c 655d 0a20 2020 2020 2020 2020 gfile]. 00000c0: 2020 5b2d 6920 6964 656e 7469 7479 5f66 [-i identity_f 00000d0: 696c 655d 205b 2d4c 205b 6269 6e64 5f61 ile] [-L [bind_a 00000e0: 6464 7265 7373 3a5d 706f 7274 3a68 6f73 ddress:]port:hos 00000f0: 743a 686f 7374 706f 7274 5d0a 2020 2020 t:hostport]. 0000100: 2020 2020 2020 205b 2d6c 206c 6f67 696e [-l login 0000110: 5f6e 616d 655d 205b 2d6d 206d 6163 5f73 _name] [-m mac_s 0000120: 7065 635d 205b 2d4f 2063 746c 5f63 6d64 pec] [-O ctl_cmd 0000130: 5d20 5b2d 6f20 6f70 7469 6f6e 5d20 5b2d ] [-o option] [- 0000140: 7020 706f 7274 5d0a 2020 2020 2020 2020 p port]. 0000150: 2020 205b 2d52 205b 6269 6e64 5f61 6464 [-R [bind_add 0000160: 7265 7373 3a5d 706f 7274 3a68 6f73 743a ress:]port:host: 0000170: 686f 7374 706f 7274 5d20 5b2d 5320 6374 hostport] [-S ct 0000180: 6c5f 7061 7468 5d0a 2020 2020 2020 2020 l_path]. 0000190: 2020 205b 2d77 2074 756e 6e65 6c3a 7475 [-w tunnel:tu 00001a0: 6e6e 656c 5d20 5b75 7365 7240 5d68 6f73 nnel] [user@]hos 00001b0: 746e 616d 6520 5b63 6f6d 6d61 6e64 5d0a tname [command]. Bill Knox Lead Infosec Engineer/Scientist The MITRE Corporation -----Original Message----- From: openssh-unix-dev-bounces+wknox=mitre.org at mindrot.org [mailto:openssh-unix-dev-bounces+wknox=mitre.org at mindrot.org] On Behalf Of Stanislaw Kaminski Sent: Monday, July 14, 2008 10:27 AM To: openssh-unix-dev at mindrot.org Subject: EOL in stderr of ssh - Linux 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? yours sincerely, Stanislaw Kaminski _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev at mindrot.org https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Stanislaw Kaminski wrote:> 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.What are your tty settings? What is the output of this command? stty -a What is the output of this command? echo ABC | od -tx1 Bob
Hi, Bob wrote:> Stanislaw Kaminski wrote: >> 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. > > What are your tty settings? What is the output of this command? > > stty -a > > What is the output of this command? > > echo ABC | od -tx1 > >Bob$ stty -aspeed 38400 baud; rows 44; columns 179; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke $ echo ABC | od -tx1 0000000 41 42 43 0a 0000004 I don't want to post this two times, so I'd like you to read my reply to Bill's post to see where I see 0x0A 0x0D. regards, Stanislaw
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
Maybe Matching Threads
- dovecot 1.0-test-56 mail doesn't show up with Mac Entourage clients
- No announcement for kernel 3.10.0-1062.12.1.el7
- [BUG] clear ACL-s on destination
- [Bug 953] openssh session hanging - prngd[671]: write() in socket_write() failed: Broken pipe
- Puppetting the puppetmaster problems