summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2016-12-15 15:15:33 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-12-15 15:15:33 +0200
commitbbdf8193924cbd78cc076b87029ab5b158984e74 (patch)
tree6852a60cf3b1254bf6bef649d513c603e001b8c7
parent120229d73ae95dc7d63dc5e206e39cd52603112c (diff)
downloadrpm-bbdf8193924cbd78cc076b87029ab5b158984e74.tar.gz
Literally blocking *all* signals is a bit too much
Programming errors like SIGSEGV and SIGBUS need to get through no matter what and blocking them is undefined behavior anyway. The odd man out in this list is SIGTSTP which is just otherwise useful and not harmful since the process can be continued afterwards.
-rw-r--r--rpmio/rpmsq.c6
-rw-r--r--rpmio/rpmsq.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c
index f4d8a8712..cd9e4ce96 100644
--- a/rpmio/rpmsq.c
+++ b/rpmio/rpmsq.c
@@ -173,6 +173,12 @@ int rpmsqBlock(int op)
blocked++;
if (blocked == 1) {
sigfillset(&newMask);
+ sigdelset(&newMask, SIGABRT);
+ sigdelset(&newMask, SIGBUS);
+ sigdelset(&newMask, SIGFPE);
+ sigdelset(&newMask, SIGILL);
+ sigdelset(&newMask, SIGSEGV);
+ sigdelset(&newMask, SIGTSTP);
ret = pthread_sigmask(SIG_BLOCK, &newMask, &oldMask);
}
} else if (op == SIG_UNBLOCK) {
diff --git a/rpmio/rpmsq.h b/rpmio/rpmsq.h
index 8cb2dc324..bffa9d447 100644
--- a/rpmio/rpmsq.h
+++ b/rpmio/rpmsq.h
@@ -45,7 +45,7 @@ int rpmsqActivate(int state);
rpmsqAction_t rpmsqSetAction(int signum, rpmsqAction_t handler);
/** \ingroup rpmsq
- * Block or unblock (all) signals.
+ * Block or unblock (almost) all signals.
* The operation is "reference counted" so the calls can be nested,
* and signals are only unblocked when the reference count falls to zero.
* @param op SIG_BLOCK/SIG_UNBLOCK