summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-01-23 07:10:22 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-01-23 18:51:25 +1100
commit3bf2a6ac791d64046a537335a0f1d5e43579c5ad (patch)
tree76fcc0f1be306541c074be4aed3aca66023f0962 /monitor.c
parente027c044c796f3a01081a91bee55741204283f28 (diff)
downloadopenssh-git-3bf2a6ac791d64046a537335a0f1d5e43579c5ad.tar.gz
upstream: Replace all calls to signal(2) with a wrapper around
sigaction(2). This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations. OpenBSD-Commit-ID: 5e047663fd77a40d7b07bdabe68529df51fd2519
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index 6ee44204..dc6d78d3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.206 2019/12/15 18:57:30 djm Exp $ */
+/* $OpenBSD: monitor.c,v 1.207 2020/01/23 07:10:22 dtucker Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -393,11 +393,11 @@ monitor_child_postauth(struct ssh *ssh, struct monitor *pmonitor)
pmonitor->m_recvfd = -1;
monitor_set_child_handler(pmonitor->m_pid);
- signal(SIGHUP, &monitor_child_handler);
- signal(SIGTERM, &monitor_child_handler);
- signal(SIGINT, &monitor_child_handler);
+ ssh_signal(SIGHUP, &monitor_child_handler);
+ ssh_signal(SIGTERM, &monitor_child_handler);
+ ssh_signal(SIGINT, &monitor_child_handler);
#ifdef SIGXFSZ
- signal(SIGXFSZ, SIG_IGN);
+ ssh_signal(SIGXFSZ, SIG_IGN);
#endif
mon_dispatch = mon_dispatch_postauth20;