]> andersk Git - gssapi-openssh.git/blobdiff - openssh/auth.c
Added support for reporting usage metrics.
[gssapi-openssh.git] / openssh / auth.c
index f95c91f4394ffcd03a211abbfcdad3e09fcc8b6d..19253fe52afe42a893e1bca3d4c429a47e40d0d4 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.79 2008/07/02 12:03:51 dtucker Exp $ */
+/* $OpenBSD: auth.c,v 1.80 2008/11/04 07:58:09 djm Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -71,6 +71,9 @@
 #endif
 #include "monitor_wrap.h"
 
+#include "version.h"
+#include "ssh-globus-usage.h"
+
 /* import */
 extern ServerOptions options;
 extern int use_privsep;
@@ -292,6 +295,21 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
        if (authenticated == 0 && !authctxt->postponed)
                audit_event(audit_classify_auth(method));
 #endif
+       if (authenticated) {
+               char *userdn = NULL;
+               char *mech_name = NULL;
+               ssh_gssapi_get_client_info(&userdn, &mech_name);
+               debug("REPORTING (%s) (%s) (%s) (%s) (%s) (%s) (%s)",
+                        SSH_RELEASE, SSLeay_version(SSLEAY_VERSION),
+                        method, mech_name?mech_name:"NULL", get_remote_ipaddr(),
+                        (authctxt->user && authctxt->user[0])?
+                               authctxt->user : "unknown",
+                       userdn?userdn:"NULL");
+               ssh_globus_send_usage_metrics(SSH_RELEASE,
+                                       SSLeay_version(SSLEAY_VERSION),
+                                       method, mech_name, get_remote_ipaddr(),
+                                       authctxt->user, userdn);
+       }
 }
 
 /*
@@ -527,6 +545,10 @@ getpwnamallow(const char *user)
            get_canonical_hostname(options.use_dns), get_remote_ipaddr());
 
        pw = getpwnam(user);
+#ifdef USE_PAM
+       if (options.use_pam && options.permit_pam_user_change && pw == NULL)
+               pw = sshpam_getpw(user);
+#endif
        if (pw == NULL) {
                logit("Invalid user %.100s from %.100s",
                      (user && user[0]) ? user : "unknown",
This page took 0.161796 seconds and 4 git commands to generate.