aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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)
tree4aedd271c4c0d3580a26f954b15d213cfcc2df74
parent1e7f35ab310b1af580799f10e801b182f45a08f1 (diff)
downloadpseudo-3b4f502bec4b52c1ee98f60ddf8061add1e4bf54.tar.gz
pseudo-3b4f502bec4b52c1ee98f60ddf8061add1e4bf54.tar.bz2
pseudo-3b4f502bec4b52c1ee98f60ddf8061add1e4bf54.zip
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!
-rw-r--r--ChangeLog.txt3
-rwxr-xr-xmakewrappers4
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 @@
+2010-08-25:
+ * (seebs) fix the signal mask restore
+
2010-08-24:
* (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;
$decl_paths
if (pseudo_populate_wrappers()) {
int save_errno;
@@ -336,6 +334,8 @@ EOF
}
} else {
$alloc_paths
+ /* exec*() use this to restore the sig mask */
+ pseudo_saved_sigmask = saved;
$(write_assign rc) wrap_$name($argnames);
$free_paths
}