summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2024-11-01 15:46:15 -0400
committerSimon Ser <contact@emersion.fr>2024-11-01 22:55:34 +0100
commit96f0a0f9c6a9412fc1886bf54e37ece75b0e9f99 (patch)
treea9ec752ec010af85104bee0f2e28861ec6e33b45 /main.c
parentfc6fbc98fba775e152443a3d587600767d451fa1 (diff)
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
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);