diff options
authorseebs <seebs@seebs-eee.(none)>2010-08-26 01:05:25 -0500
committerseebs <seebs@seebs-eee.(none)>2010-08-26 01:05:25 -0500
commit3b4f502bec4b52c1ee98f60ddf8061add1e4bf54 (patch)
parent1e7f35ab310b1af580799f10e801b182f45a08f1 (diff)
Almost had it! The problem is that because the save of
pseudo_saved_sigmask occurred outside of the check against antimagic, calls to wrapped functions made by the internals of a wrapper resulted on overwriting pseudo_saved_sigmask, so we restored the already-blocked sigmask. This could result in programs getting their sigmask permanently changed to block various signals, most crucially SIGCHLD. We now stash the value immediately before calling a wrapper, and never stash it if we're not calling a wrapper. Now the anti-magic stuff happening inside wrappers isn't trashing the signal mask. YAY!
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 9e39f90..1a6c086 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+ * (seebs) fix the signal mask restore
* (seebs) try to restore signal mask before calling exec()
* (seebs) move errno restoration after code which could set errno
diff --git a/makewrappers b/makewrappers
index 5b023b4..c2e6cf6 100755
--- a/makewrappers
+++ b/makewrappers
@@ -318,8 +318,6 @@ EOF
sigprocmask(SIG_SETMASK, &saved, NULL);
$(write_return $default_value);
- /* this may get restored if we end up calling exec*() */
- pseudo_saved_sigmask = saved;
if (pseudo_populate_wrappers()) {
int save_errno;
@@ -336,6 +334,8 @@ EOF
} else {
+ /* exec*() use this to restore the sig mask */
+ pseudo_saved_sigmask = saved;
$(write_assign rc) wrap_$name($argnames);