summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-03-03 10:31:28 +0200
committerMichal Domonkos <mdomonko@redhat.com>2022-07-01 10:52:14 +0200
commit491537593e9fcab2d25b1816fc6bba846c599337 (patch)
tree0161dc07dea62e15f34843f6432bb93a4ab7e7a7
parent9c287867531d6ab932d74d891d61fd6f7ac4da44 (diff)
downloadrpm-491537593e9fcab2d25b1816fc6bba846c599337.tar.gz
Fix regression on ctrl-c during transaction killing scriptlets
Commit cb6aa82dbc10d554f8d234e934ae7c77e39a3ce2 unblocked all signals from scriptlets, but turns out this is too much: SIGINT, SIGTSTP and SIGQUIT sent from the terminal are passed to the process group, and with unblocked signals end up killing our scriptlets while rpm itself continues. -ENOSENSE. Stopping (and continuing) is okay though so we don't block that. (cherry picked from commit 25c4c61a9599590ce4d610621ff0bffde7ae5e82)
-rw-r--r--lib/rpmscript.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rpmscript.c b/lib/rpmscript.c
index dbc7b0bbd..a37e98bac 100644
--- a/lib/rpmscript.c
+++ b/lib/rpmscript.c
@@ -161,8 +161,10 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
int xx;
sigset_t set;
- /* Unmask all signals, the scripts may need them */
+ /* Unmask most signals, the scripts may need them */
sigfillset(&set);
+ sigdelset(&set, SIGINT);
+ sigdelset(&set, SIGQUIT);
sigprocmask(SIG_UNBLOCK, &set, NULL);
/* SIGPIPE is ignored in rpm, reset to default for the scriptlet */