Bug 1162 - Inappropriate sequence of syslog messages
Summary: Inappropriate sequence of syslog messages
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 4.2p1
Hardware: Other All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_4_4
  Show dependency treegraph
 
Reported: 2006-02-24 16:08 AEDT by senthilkumar
Modified: 2006-09-28 19:25 AEST (History)
0 users

See Also:


Attachments
Patch to fix the Inappropriate sequence of log messages (1.49 KB, patch)
2006-02-24 16:14 AEDT, senthilkumar
no flags Details | Diff
Reorder log statement (720 bytes, patch)
2006-03-12 15:20 AEDT, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description senthilkumar 2006-02-24 16:08:14 AEDT
I came across Inappropriate sequence of syslog messages saying server is listening on desired port when the listen call fails.

Feb 24 12:41:38 ssh-165 sshd[2616]: Server listening on 0.0.0.0 port 1111.
Feb 24 12:41:38 ssh-165 sshd[2616]: fatal: listen: Socket operation on non-socket
Comment 1 senthilkumar 2006-02-24 16:14:11 AEDT
Created attachment 1080 [details]
Patch to fix the Inappropriate sequence of log messages

This behaviour also happens with bind() call and the attached patch fixes the problem.
Comment 2 Darren Tucker 2006-03-08 00:04:47 AEDT
Comment on attachment 1080 [details]
Patch to fix the Inappropriate sequence of log messages

>-                       debug("Bind to port %s on %s.", strport, ntop);

These things are only debugs and are intended to describe what it's about to try
(and thus the source of any immediately subsequent errors).

>-                       logit("Server listening on %s port %s.", ntop, strport);
>                        if (listen(listen_sock, SSH_LISTEN_BACKLOG) < 0)
>                                fatal("listen: %.100s", strerror(errno));
>+                       else
>+                               logit("Server listening on %s port %s.", ntop, strport);

The problem with doing that is that if it fails you now don't know which of the ports that the listen failed on (remember, there can be more than one).
Comment 3 Damien Miller 2006-03-12 15:20:01 AEDT
Created attachment 1096 [details]
Reorder log statement

This is probably better, and simpler
Comment 4 Darren Tucker 2006-03-13 19:13:52 AEDT
Comment on attachment 1096 [details]
Reorder log statement

ok by me
Comment 5 Damien Miller 2006-03-13 19:18:06 AEDT
patch applied, will be in 4.4
Comment 6 Darren Tucker 2006-09-28 19:25:56 AEST
With the release of 4.4, we believe that this bug is now closed.  For information about the release please see http://www.openssh.com/txt/release-4.4 .