]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tty-ask-pwd-agent: treat SIGINT as a request to exit immediately
authorFranck Bui <fbui@suse.com>
Thu, 19 Sep 2019 13:24:15 +0000 (15:24 +0200)
committerFranck Bui <fbui@suse.com>
Sat, 5 Oct 2019 06:08:24 +0000 (08:08 +0200)
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.

src/tty-ask-password-agent/tty-ask-password-agent.c

index 504ba9162dbae53c80550fc20f3e729a19c92d78..81eca2ec41a7114fedee94f84d763deaf18db5cf 100644 (file)
@@ -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);