summaryrefslogtreecommitdiffstats
path: root/filter.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-06-18 14:53:12 -0700
committerKevin McCarthy <kevin@8t8.us>2021-06-18 15:13:16 -0700
commit80ed1d851aca88202654ee55c943e8762fcc1e7f (patch)
tree1027dbde30c1c413a07dcaa1e13e7774674484c8 /filter.c
parent9155c6576d09cf17f27fed3041cb3cba7810ba6b (diff)
Reset SIGPIPE signal handler in child process before exec().
Ignored signals, such as SIGPIPE in Mutt, are inherited by child processes. This can cause incorrect behavior in filter-like programs that expect SIGPIPE to be the default value of "Term". A couple other places in Mutt already reset SIGTERM, SIGTSTP, and SIGCONT, with a comment mentioning it really wasn't necessary. Since I don't much like messing with signals, I'll leave those resets in. Extract those plus SIGPIPE into a new function, mutt_reset_child_signals() and add that before each exec call. Thanks to Vincent Lefèvre for reporting the issue and for the initial patch, which this commit is based upon.
Diffstat (limited to 'filter.c')
-rw-r--r--filter.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/filter.c b/filter.c
index a49eb271..0dab2f93 100644
--- a/filter.c
+++ b/filter.c
@@ -85,6 +85,7 @@ mutt_create_filter_fd (const char *cmd, FILE **in, FILE **out, FILE **err,
if ((thepid = fork ()) == 0)
{
mutt_unblock_signals_system (0);
+ mutt_reset_child_signals ();
if (in)
{