1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-01 01:52:17 +01:00

improved debug messages when getpwnam_r() doesn't return a user

This commit is contained in:
Klas Lindfors 2017-08-30 08:32:54 +02:00
parent 3d0d9f52e5
commit dbaf857ef0
No known key found for this signature in database
GPG Key ID: BCA00FD4B2168C0A

View File

@ -168,8 +168,12 @@ authorize_user_token (struct cfg *cfg,
pwres = getpwnam_r (username, &pass, buf, buflen, &p);
if (p == NULL) {
DBG ("getpwnam_r: %s", strerror(pwres));
return AUTH_ERROR;
if (pwres == 0) {
DBG ("User '%s' not found", username);
} else {
DBG ("getpwnam_r: %s", strerror(pwres));
}
return AUTH_ERROR;
}
/* Getting file from user home directory
@ -475,7 +479,11 @@ do_challenge_response(pam_handle_t *pamh, struct cfg *cfg, const char *username)
pwres = getpwnam_r (username, &pass, pwbuf, pwbuflen, &p);
if (p == NULL) {
DBG ("getpwnam_r: %s", strerror(pwres));
if (pwres == 0) {
DBG ("User '%s' not found", username);
} else {
DBG ("getpwnam_r: %s", strerror(pwres));
}
goto out;
}