diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2024-01-04 17:46:51 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2024-01-04 17:46:51 +0100 |
commit | 76af6380776a81ffd6ff50de254fb448ec6bce79 (patch) | |
tree | 5b36f3fae2c72cb38e6273f238b3b0d4938f3daf | |
parent | 8a400c3d15a1beefb2d804c176b806566091ded8 (diff) | |
download | pam-76af6380776a81ffd6ff50de254fb448ec6bce79.tar.gz pam-76af6380776a81ffd6ff50de254fb448ec6bce79.tar.bz2 pam-76af6380776a81ffd6ff50de254fb448ec6bce79.zip |
pam_timestamp: correct failure condition
Bail out on NULL pointer, not otherwise.
Reported by cppcheck.
Fixes: 8a3f0810 ("Y2038: use logind instead of utmp")
-rw-r--r-- | modules/pam_timestamp/pam_timestamp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c index 08300164..7c5457c4 100644 --- a/modules/pam_timestamp/pam_timestamp.c +++ b/modules/pam_timestamp/pam_timestamp.c @@ -557,7 +557,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) } #ifdef USE_LOGIND struct passwd *pwd = pam_modutil_getpwnam(pamh, ruser); - if (pwd != NULL) { + if (pwd == NULL) { return PAM_SERVICE_ERR; } if (check_login_time(pwd->pw_uid, then) != PAM_SUCCESS) |