]> andersk Git - gssapi-openssh.git/blobdiff - openssh/auth-pam.c
Import of OpenSSH 3.6.1p2
[gssapi-openssh.git] / openssh / auth-pam.c
index c91de9da479923da29fe11f9cb501b2538148449..d58e74d760da744926ae2ba50ab65f40034dd7b7 100644 (file)
@@ -201,7 +201,7 @@ void do_pam_cleanup_proc(void *context)
        }
 }
 
-/* Attempt password authentation using PAM */
+/* Attempt password authentication using PAM */
 int auth_pam_password(Authctxt *authctxt, const char *password)
 {
        extern ServerOptions options;
@@ -215,13 +215,13 @@ int auth_pam_password(Authctxt *authctxt, const char *password)
        pamstate = INITIAL_LOGIN;
        pam_retval = do_pam_authenticate(
            options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0);
-       if (pam_retval == PAM_SUCCESS) {
-               debug("PAM Password authentication accepted for "
-                   "user \"%.100s\"", pw->pw_name);
+       if (pam_retval == PAM_SUCCESS && pw) {
+               debug("PAM password authentication accepted for "
+                   "%.100s", pw->pw_name);
                return 1;
        } else {
-               debug("PAM Password authentication for \"%.100s\" "
-                   "failed[%d]: %s", pw->pw_name, pam_retval, 
+               debug("PAM password authentication failed for "
+                   "%.100s: %s", pw ? pw->pw_name : "an illegal user",
                    PAM_STRERROR(__pamh, pam_retval));
                return 0;
        }
This page took 0.098692 seconds and 4 git commands to generate.