summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent/tty-ask-password-agent.c
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2019-09-19 15:24:15 +0200
committerFranck Bui <fbui@suse.com>2019-10-05 08:08:24 +0200
commit998c6da8ca37326dfc38e16fdf0d30b1c6c20d97 (patch)
treea4b3afd359db560b03c8ccf439545c8cfda45c55 /src/tty-ask-password-agent/tty-ask-password-agent.c
parentd325f2443eceb423a02b26852065a25ed21a992c (diff)
downloadsystemd-998c6da8ca37326dfc38e16fdf0d30b1c6c20d97.tar.gz
tty-ask-pwd-agent: treat SIGINT as a request to exit immediately
Unlike SIGTERM, SIGINT is now treated as a request to exit as soon as possible. IOW, if SIGINT is received, the agent wont process all remaining passwords before exiting. This allows a more comprehensive behavior when C-c is pressed and when the agent is spawned by systemctl. Before that patch, pressing C-c killed systemctl but left the agent waiting for a password since SIGINT was blocked. The result was pretty clumsy.
Diffstat (limited to 'src/tty-ask-password-agent/tty-ask-password-agent.c')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 504ba9162d..81eca2ec41 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -515,7 +515,7 @@ static int process_and_watch_password_files(void) {
return r;
assert_se(sigemptyset(&mask) >= 0);
- assert_se(sigset_add_many(&mask, SIGINT, SIGTERM, -1) >= 0);
+ assert_se(sigset_add_many(&mask, SIGTERM, -1) >= 0);
assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) >= 0);
signal_fd = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);