diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-01-23 07:10:22 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 18:51:25 +1100 |
commit | 3bf2a6ac791d64046a537335a0f1d5e43579c5ad (patch) | |
tree | 76fcc0f1be306541c074be4aed3aca66023f0962 /monitor.c | |
parent | e027c044c796f3a01081a91bee55741204283f28 (diff) |
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: monitor.c,v 1.206 2019/12/15 18:57:30 djm Exp $ */ | 1 | /* $OpenBSD: monitor.c,v 1.207 2020/01/23 07:10:22 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> | 3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> |
4 | * Copyright 2002 Markus Friedl <markus@openbsd.org> | 4 | * Copyright 2002 Markus Friedl <markus@openbsd.org> |
@@ -393,11 +393,11 @@ monitor_child_postauth(struct ssh *ssh, struct monitor *pmonitor) | |||
393 | pmonitor->m_recvfd = -1; | 393 | pmonitor->m_recvfd = -1; |
394 | 394 | ||
395 | monitor_set_child_handler(pmonitor->m_pid); | 395 | monitor_set_child_handler(pmonitor->m_pid); |
396 | signal(SIGHUP, &monitor_child_handler); | 396 | ssh_signal(SIGHUP, &monitor_child_handler); |
397 | signal(SIGTERM, &monitor_child_handler); | 397 | ssh_signal(SIGTERM, &monitor_child_handler); |
398 | signal(SIGINT, &monitor_child_handler); | 398 | ssh_signal(SIGINT, &monitor_child_handler); |
399 | #ifdef SIGXFSZ | 399 | #ifdef SIGXFSZ |
400 | signal(SIGXFSZ, SIG_IGN); | 400 | ssh_signal(SIGXFSZ, SIG_IGN); |
401 | #endif | 401 | #endif |
402 | 402 | ||
403 | mon_dispatch = mon_dispatch_postauth20; | 403 | mon_dispatch = mon_dispatch_postauth20; |