From: Lennart Poettering Date: Tue, 28 Nov 2023 08:31:04 +0000 (+0100) Subject: pam_systemd_home: port over to pam_get_item_many() X-Git-Tag: v256-rc1~1301^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30739%2Fhead;p=thirdparty%2Fsystemd.git pam_systemd_home: port over to pam_get_item_many() --- diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c index ba8d8f60545..30f624b6e2b 100644 --- a/src/home/pam_systemd_home.c +++ b/src/home/pam_systemd_home.c @@ -969,13 +969,12 @@ _public_ PAM_EXTERN int pam_sm_chauthtok( return r; /* Start with cached credentials */ - r = pam_get_item(handle, PAM_OLDAUTHTOK, (const void**) &old_password); - if (!IN_SET(r, PAM_BAD_ITEM, PAM_SUCCESS)) - return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get old password: @PAMERR@"); - - r = pam_get_item(handle, PAM_AUTHTOK, (const void**) &new_password); - if (!IN_SET(r, PAM_BAD_ITEM, PAM_SUCCESS)) - return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get cached password: @PAMERR@"); + r = pam_get_item_many( + handle, + PAM_OLDAUTHTOK, &old_password, + PAM_AUTHTOK, &new_password); + if (r != PAM_SUCCESS) + return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get cached passwords: @PAMERR@"); if (isempty(new_password)) { /* No, it's not cached, then let's ask for the password and its verification, and cache