From 927e09fb7dac85df8e21c64989b65bcd3383d67e Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PointerDilemma@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:35:26 +0000 Subject: [PATCH] pam: start conversation right away (#1003) * Revert "auth: don't start pam conversation before the initial input happens (#409)" This reverts commit 3bedae44368b1e490ff0d5a9f3fd508a4041d3a5. * pam: fix some logic cleanup --- src/auth/Pam.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/auth/Pam.cpp b/src/auth/Pam.cpp index 813ab92..e1f9404 100644 --- a/src/auth/Pam.cpp +++ b/src/auth/Pam.cpp @@ -27,18 +27,17 @@ int conv(int num_msg, const struct pam_message** msg, struct pam_response** resp const auto PROMPTCHANGED = PROMPT != CONVERSATIONSTATE->prompt; Log::logger->log(Log::INFO, "PAM_PROMPT: {}", PROMPT); - if (PROMPTCHANGED) - g_pHyprlock->enqueueForceUpdateTimers(); - // Some pam configurations ask for the password twice for whatever reason (Fedora su for example) // When the prompt is the same as the last one, I guess our answer can be the same. - if (!initialPrompt && PROMPTCHANGED) { + if (initialPrompt || PROMPTCHANGED) { CONVERSATIONSTATE->prompt = PROMPT; + g_pHyprlock->enqueueForceUpdateTimers(); + CONVERSATIONSTATE->waitForInput(); } // Needed for unlocks via SIGUSR1 - if (g_pHyprlock->isUnlocked()) + if (g_pHyprlock->m_bTerminate) return PAM_CONV_ERR; pamReply[i].resp = strdup(CONVERSATIONSTATE->input.c_str()); @@ -83,18 +82,14 @@ void CPam::init() { while (true) { resetConversation(); - // Initial input - m_sConversationState.prompt = "Password: "; - waitForInput(); - // For grace or SIGUSR1 unlocks - if (g_pHyprlock->isUnlocked()) + if (g_pHyprlock->m_bTerminate) return; const auto AUTHENTICATED = auth(); // For SIGUSR1 unlocks - if (g_pHyprlock->isUnlocked()) + if (g_pHyprlock->m_bTerminate) return; if (!AUTHENTICATED)