diff options
| author | Kenny Levinsen <kl@kl.wtf> | 2025-04-27 18:17:21 +0200 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2025-04-27 18:30:04 +0200 |
| commit | ae8011a3548f32980af9e915189b1d48f019f77f (patch) | |
| tree | 95a64565c380a7d1b37f6e9a97f8e7253512563c | |
| parent | a1cf39ab0ff0687994a66ba116b316bc59849e2c (diff) | |
Ignore SIGUSR1 in the backend child process
If a user calls `killall -USR1 swaylock`, they may end up signalling the
password backend. As the password backend forked before SIGUSR1 handling
was set up, it inherits the default handler and terminates.
Set the SIGUSR1 handler to SIG_IGN in the child process.
Fixes: https://github.com/swaywm/swaylock/issues/409
| -rw-r--r-- | comm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -96,6 +96,10 @@ bool spawn_comm_child(void) { swaylock_log_errno(LOG_ERROR, "failed to fork"); return false; } else if (child == 0) { + struct sigaction sa = { + .sa_handler = SIG_IGN, + }; + sigaction(SIGUSR1, &sa, NULL); close(comm[0][1]); close(comm[1][0]); run_pw_backend_child(); |
