]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
don't leak PAM handle on repeat invocations
authorDamien Miller <djm@mindrot.org>
Tue, 14 Oct 2025 03:52:50 +0000 (14:52 +1100)
committerDamien Miller <djm@mindrot.org>
Tue, 14 Oct 2025 03:53:33 +0000 (14:53 +1100)
Reported by Casper Dik via bz3882; ok dtucker@

auth-pam.c

index 5591f094ece3ed304600391b467add9675db8843..965de210060f988f3ea26e6fd2b3739572b209b3 100644 (file)
@@ -735,6 +735,7 @@ sshpam_init(struct ssh *ssh, Authctxt *authctxt)
                /* We already have a PAM context; check if the user matches */
                if ((sshpam_err = check_pam_user(authctxt)) != PAM_SUCCESS)
                        fatal("PAM user mismatch");
+               return 0;
        }
        debug("PAM: initializing for \"%s\" with service \"%s\"", user,
            options.pam_service_name);