From fc6fbc98fba775e152443a3d587600767d451fa1 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sat, 12 Oct 2024 09:24:10 -0400 Subject: [PATCH] Stop processing auth requests after success The child process handling PAM authentication can have multiple requests queued up. As the first success will unlock the screen, there is no point in processing anything afterwards. --- pam.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pam.c b/pam.c index 0e48fcc..5472a9e 100644 --- a/pam.c +++ b/pam.c @@ -109,6 +109,12 @@ void run_pw_backend_child(void) { if (!write_comm_reply(success)) { exit(EXIT_FAILURE); } + + if (success) { + /* Unsuccessful requests may be queued after a successful one; + * do not process them. */ + break; + } } pam_setcred(auth_handle, PAM_REFRESH_CRED);