From 3a39206f41727b7bab509a21aab92575d153c313 Mon Sep 17 00:00:00 2001 From: djm Date: Wed, 14 May 2003 09:31:12 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2003/05/14 08:57:49 [monitor.c] 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 --- ChangeLog | 5 +++++ monitor.c | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f731c075..a54c97b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,11 @@ - better formatting in SYNOPSIS - whitespace at EOL ok djm@ + - markus@cvs.openbsd.org 2003/05/14 08:57:49 + [monitor.c] + 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 - (djm) Make portable build with MIT krb5 (some issues remain) - (djm) Add new UsePAM configuration directive to allow runtime control over usage of PAM. This allows non-root use of sshd when built with diff --git a/monitor.c b/monitor.c index 36f9a6c2..700925c8 100644 --- a/monitor.c +++ b/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 @@ -143,6 +143,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; @@ -321,9 +322,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; -- 2.45.2