aboutsummaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-04-19 16:13:27 -0700
committerJunio C Hamano <gitster@pobox.com>2017-04-20 17:55:32 -0700
commit45afb1ca9c28855096c94926e5b16dfbcde7381f (patch)
tree0f9edd2f8b31c420d03e24336881c50308437d54 /help.c
parente503cd6ed336d70d716e194ef6c5469330bea9da (diff)
downloadgit-45afb1ca9c28855096c94926e5b16dfbcde7381f.tar.gz
git-45afb1ca9c28855096c94926e5b16dfbcde7381f.tar.xz
run-command: block signals between fork and execve
Signal handlers of the parent firing in the forked child may have unintended side effects. Rather than auditing every signal handler we have and will ever have, block signals while forking and restore default signal handlers in the child before execve. Restoring default signal handlers is required because execve does not unblock signals, it only restores default signal handlers. So we must restore them with sigprocmask before execve, leaving a window when signal handlers we control can fire in the child. Continue ignoring ignored signals, but reset the rest to defaults. Similarly, disable pthread cancellation to future-proof our code in case we start using cancellation; as cancellation is implemented with signals in glibc. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
0 files changed, 0 insertions, 0 deletions