diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-05-14 08:57:50 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-05-14 08:57:50 +0000 |
commit | 59b77577013fecdf012bd99a07e5833307b02471 (patch) | |
tree | 98a6ed0c783c7ebc7d91e95c70d32ca49c719b9f /usr.bin/ssh | |
parent | b3e4f6cc0d067ebf3637a604aa9dea28f9043e20 (diff) |
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
Diffstat (limited to 'usr.bin/ssh')
-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; |