From: Tobias Stoeckmann Date: Tue, 7 Apr 2026 17:53:09 +0000 (+0200) Subject: login-utils/auth: Drop pam_setcred X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa97b45aa2680e4e2f955cf4805a76146b7b46a3;p=thirdparty%2Futil-linux.git login-utils/auth: Drop pam_setcred The credentials are not needed right before pam_end. Drop the call, which avoids the requirement of cleaning them up again. While at it, supply the last retcode into pam_end, even though it's always 0 anyway. Signed-off-by: Tobias Stoeckmann --- diff --git a/login-utils/auth.c b/login-utils/auth.c index fdeb12bbc..8b93624a4 100644 --- a/login-utils/auth.c +++ b/login-utils/auth.c @@ -53,11 +53,7 @@ int auth_pam(const char *service_name, uid_t uid, const char *username) if (pam_fail_check(pamh, retcode)) return FALSE; - retcode = pam_setcred(pamh, 0); - if (pam_fail_check(pamh, retcode)) - return FALSE; - - pam_end(pamh, 0); + pam_end(pamh, retcode); /* no need to establish a session; this isn't a * session-oriented activity... */ }