summaryrefslogtreecommitdiff
path: root/dbus/dbus-spawn.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2012-10-16 14:38:28 -0400
committerRay Strode <rstrode@redhat.com>2012-10-16 14:44:55 -0400
commit90f939f155bd120f44ff3906296707a6c00cd462 (patch)
treebe92759971395e6e481ed6929bb8bb22f8e73fa5 /dbus/dbus-spawn.c
parentd728fdc655f17031da3bb129ab2fd17dadf0fe3a (diff)
downloaddbus-90f939f155bd120f44ff3906296707a6c00cd462.tar.gz
dbus-spawn: set SIGPIPE to SIG_IGN before activating services
dbus's service activation code sets SIGPIPE to SIG_DFL as a sort of poor man's prctl(... PR_SET_PDEATHSIG) to detect when the parent goes away. It neglects to reignore the infamous signal before performing activation, however. This means if, for instance, journald is restarted all services activated after it will die with SIGPIPE when logging messages unless they explicitly ignore SIGPIPE themselves. This commit changes dbus's service activation code to correctly ignore SIGPIPE to protect activated services from a gruesome, premature death. Reviewed-by: Lennart Poettering <lennart@poettering.net> https://bugzilla.redhat.com/show_bug.cgi?id=839258
Diffstat (limited to 'dbus/dbus-spawn.c')
-rw-r--r--dbus/dbus-spawn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c
index ef00801c..1e3a3516 100644
--- a/dbus/dbus-spawn.c
+++ b/dbus/dbus-spawn.c
@@ -1256,7 +1256,11 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
_dbus_assert_not_reached ("Got to code after write_err_and_exit()");
}
else if (grandchild_pid == 0)
- {
+ {
+ /* Go back to ignoring SIGPIPE, since it's evil
+ */
+ signal (SIGPIPE, SIG_IGN);
+
do_exec (child_err_report_pipe[WRITE_END],
argv,
env,