diff -r 2b7e90a4d3ce libpam/pam_google_authenticator.c --- a/libpam/pam_google_authenticator.c Wed Feb 23 16:29:42 2011 -0800 +++ b/libpam/pam_google_authenticator.c Mon Feb 28 16:22:32 2011 +0000 @@ -568,6 +568,15 @@ // If nothing matched, display an error message if (rc != PAM_SUCCESS) { log_message(LOG_ERR, pamh, "Invalid verification code"); + rc = PAM_PERM_DENIED; + } + } else { + if (username) { + if (fd<0) { + rc = PAM_CRED_UNAVAIL; + } else if (buf==NULL || secret==NULL) { + rc = PAM_AUTHTOK_ERR; + } } }