summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-02-09 09:53:48 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-02-09 09:53:48 +1100
commit96d4710e3838af8c03a55ce37913568877dd0283 (patch)
treecfa394a8c8023fb6f521411b95d35c175daa90d3
parent5b53026f719bc0b2fc13a58ea0b6a0385e373bec (diff)
- dtucker@cvs.openbsd.org 2005/02/08 22:24:57
[sshd.c] Provide reason in error message if getnameinfo fails; ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--sshd.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a735139..98cdf96a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
- dtucker@cvs.openbsd.org 2005/01/30 11:18:08
[monitor.c]
Make code match intent; ok djm@
+ - dtucker@cvs.openbsd.org 2005/02/08 22:24:57
+ [sshd.c]
+ Provide reason in error message if getnameinfo fails; ok markus@
20050208
- (dtucker) [regress/test-exec.sh] Bug #912: Set _POSIX2_VERSION for the
@@ -2104,4 +2107,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3643 2005/02/08 22:52:17 dtucker Exp $
+$Id: ChangeLog,v 1.3644 2005/02/08 22:53:48 dtucker Exp $
diff --git a/sshd.c b/sshd.c
index 6b379521..a5b7f1ca 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.307 2005/01/21 08:32:02 otto Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.308 2005/02/08 22:24:57 dtucker Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -1268,10 +1268,12 @@ main(int ac, char **av)
if (num_listen_socks >= MAX_LISTEN_SOCKS)
fatal("Too many listen sockets. "
"Enlarge MAX_LISTEN_SOCKS");
- if (getnameinfo(ai->ai_addr, ai->ai_addrlen,
+ if ((ret = getnameinfo(ai->ai_addr, ai->ai_addrlen,
ntop, sizeof(ntop), strport, sizeof(strport),
- NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
- error("getnameinfo failed");
+ NI_NUMERICHOST|NI_NUMERICSERV)) != 0) {
+ error("getnameinfo failed: %.100s",
+ (ret != EAI_SYSTEM) ? gai_strerror(ret) :
+ strerror(errno));
continue;
}
/* Create socket for listening. */