From 96f0a0f9c6a9412fc1886bf54e37ece75b0e9f99 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Fri, 1 Nov 2024 15:46:15 -0400 Subject: [PATCH] Exit when password handling subprocess crashes It is better to have swaylock crash immediately and the compositor show a red screen than to operate in a degraded state where passwords cannot be checked and the screen cannot be unlocked. --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 2f32f49..c0d7226 100644 --- a/main.c +++ b/main.c @@ -1038,6 +1038,9 @@ static void comm_in(int fd, short mask, void *data) { if (read_comm_reply()) { // Authentication succeeded state.run_display = false; + } else if (mask & (POLLHUP | POLLERR)) { + swaylock_log(LOG_ERROR, "Password checking subprocess crashed; exiting."); + exit(EXIT_FAILURE); } else { state.auth_state = AUTH_STATE_INVALID; schedule_auth_idle(&state);