diff options
author | 2003-05-14 08:57:49 +0000 | |
---|---|---|
committer | 2003-05-14 08:57:49 +0000 | |
commit | 92912e3719072e8619788c942d475d67d532ca52 (patch) | |
tree | 4c7ce537fcb808388fa893995a7712e8f9c15699 | |
parent | pflogd now uses the new pflog link type. Trying to append to an existing (diff) | |
download | wireguard-openbsd-92912e3719072e8619788c942d475d67d532ca52.tar.xz wireguard-openbsd-92912e3719072e8619788c942d475d67d532ca52.zip |
http://bugzilla.mindrot.org/show_bug.cgi?id=560
Privsep child continues to run after monitor killed.
Pass monitor signals through to child; Darren Tucker
-rw-r--r-- | usr.bin/ssh/monitor.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index 2156a887983..a2694101826 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.39 2003/05/14 02:15:47 markus Exp $"); +RCSID("$OpenBSD: monitor.c,v 1.40 2003/05/14 08:57:49 markus Exp $"); #include <openssl/dh.h> @@ -135,6 +135,7 @@ static char *hostbased_chost = NULL; static char *auth_method = "unknown"; static int session_id2_len = 0; static u_char *session_id2 = NULL; +static pid_t monitor_child_pid; struct mon_table { enum monitor_reqtype type; @@ -299,9 +300,25 @@ monitor_child_preauth(struct monitor *pmonitor) return (authctxt); } +static void +monitor_set_child_handler(pid_t pid) +{ + monitor_child_pid = pid; +} + +static void +monitor_child_handler(int signal) +{ + kill(monitor_child_pid, signal); +} + void monitor_child_postauth(struct monitor *pmonitor) { + monitor_set_child_handler(pmonitor->m_pid); + signal(SIGHUP, &monitor_child_handler); + signal(SIGTERM, &monitor_child_handler); + if (compat20) { mon_dispatch = mon_dispatch_postauth20; |