]> andersk Git - openssh.git/blobdiff - sshd.c
- (dtucker) [auth.h sshd.c openbsd-compat/port-aix.c] Bug #1006: fix bug in
[openssh.git] / sshd.c
diff --git a/sshd.c b/sshd.c
index e61870ea584010c6e4fccdc39b7109065bebd5d6..b3fcc6964e201a3a3bad7ab1bfdb978aa6ba5dd9 100644 (file)
--- 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. */
@@ -1628,7 +1630,7 @@ main(int ac, char **av)
        remote_port = get_remote_port();
        remote_ip = get_remote_ipaddr();
 
-#ifdef AUDIT_EVENTS
+#ifdef SSH_AUDIT_EVENTS
        audit_connection_from(remote_ip, remote_port);
 #endif
 #ifdef LIBWRAP
@@ -1671,6 +1673,8 @@ main(int ac, char **av)
        authctxt = xmalloc(sizeof(*authctxt));
        memset(authctxt, 0, sizeof(*authctxt));
 
+       authctxt->loginmsg = &loginmsg;
+
        /* XXX global for cleanup, access from other modules */
        the_authctxt = authctxt;
 
@@ -1700,8 +1704,8 @@ main(int ac, char **av)
        }
 
  authenticated:
-#ifdef AUDIT_EVENTS
-       audit_event(AUTH_SUCCESS);
+#ifdef SSH_AUDIT_EVENTS
+       audit_event(SSH_AUTH_SUCCESS);
 #endif
 
        /*
@@ -1726,6 +1730,10 @@ main(int ac, char **av)
                finish_pam();
 #endif /* USE_PAM */
 
+#ifdef SSH_AUDIT_EVENTS
+       PRIVSEP(audit_event(SSH_CONNECTION_CLOSE));
+#endif
+
        packet_close();
 
        if (use_privsep)
@@ -2017,10 +2025,10 @@ cleanup_exit(int i)
 {
        if (the_authctxt)
                do_cleanup(the_authctxt);
-#ifdef AUDIT_EVENTS
+#ifdef SSH_AUDIT_EVENTS
        /* done after do_cleanup so it can cancel the PAM auth 'thread' */
        if (!use_privsep || mm_is_monitor())
-               audit_event(CONNECTION_ABANDON);
+               audit_event(SSH_CONNECTION_ABANDON);
 #endif
        _exit(i);
 }
This page took 0.045838 seconds and 4 git commands to generate.