summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-14 19:31:12 +1000
committerDamien Miller <djm@mindrot.org>2003-05-14 19:31:12 +1000
commitbe64d43d01bd6cdad89fee1db0e3b559d97cef96 (patch)
treec797a10cd0650853e70a8ad8103b160c5eafeffd
parentd6ead282dbf346f9037f6f8aa370c7ebbfbb5c62 (diff)
- 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
-rw-r--r--ChangeLog7
-rw-r--r--monitor.c19
2 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fc81a360..6b8fe8474 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,11 @@
72 - better formatting in SYNOPSIS 72 - better formatting in SYNOPSIS
73 - whitespace at EOL 73 - whitespace at EOL
74 ok djm@ 74 ok djm@
75 - markus@cvs.openbsd.org 2003/05/14 08:57:49
76 [monitor.c]
77 http://bugzilla.mindrot.org/show_bug.cgi?id=560
78 Privsep child continues to run after monitor killed.
79 Pass monitor signals through to child; Darren Tucker
75 - (djm) Make portable build with MIT krb5 (some issues remain) 80 - (djm) Make portable build with MIT krb5 (some issues remain)
76 - (djm) Add new UsePAM configuration directive to allow runtime control 81 - (djm) Add new UsePAM configuration directive to allow runtime control
77 over usage of PAM. This allows non-root use of sshd when built with 82 over usage of PAM. This allows non-root use of sshd when built with
@@ -1465,4 +1470,4 @@
1465 save auth method before monitor_reset_key_state(); bugzilla bug #284; 1470 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1466 ok provos@ 1471 ok provos@
1467 1472
1468$Id: ChangeLog,v 1.2697 2003/05/14 09:30:38 djm Exp $ 1473$Id: ChangeLog,v 1.2698 2003/05/14 09:31:12 djm Exp $
diff --git a/monitor.c b/monitor.c
index 36f9a6c20..700925c8c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.39 2003/05/14 02:15:47 markus Exp $"); 28RCSID("$OpenBSD: monitor.c,v 1.40 2003/05/14 08:57:49 markus Exp $");
29 29
30#include <openssl/dh.h> 30#include <openssl/dh.h>
31 31
@@ -143,6 +143,7 @@ static char *hostbased_chost = NULL;
143static char *auth_method = "unknown"; 143static char *auth_method = "unknown";
144static int session_id2_len = 0; 144static int session_id2_len = 0;
145static u_char *session_id2 = NULL; 145static u_char *session_id2 = NULL;
146static pid_t monitor_child_pid;
146 147
147struct mon_table { 148struct mon_table {
148 enum monitor_reqtype type; 149 enum monitor_reqtype type;
@@ -321,9 +322,25 @@ monitor_child_preauth(struct monitor *pmonitor)
321 return (authctxt); 322 return (authctxt);
322} 323}
323 324
325static void
326monitor_set_child_handler(pid_t pid)
327{
328 monitor_child_pid = pid;
329}
330
331static void
332monitor_child_handler(int signal)
333{
334 kill(monitor_child_pid, signal);
335}
336
324void 337void
325monitor_child_postauth(struct monitor *pmonitor) 338monitor_child_postauth(struct monitor *pmonitor)
326{ 339{
340 monitor_set_child_handler(pmonitor->m_pid);
341 signal(SIGHUP, &monitor_child_handler);
342 signal(SIGTERM, &monitor_child_handler);
343
327 if (compat20) { 344 if (compat20) {
328 mon_dispatch = mon_dispatch_postauth20; 345 mon_dispatch = mon_dispatch_postauth20;
329 346