diff options
author | Damien Miller <djm@mindrot.org> | 2003-05-14 19:31:12 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-05-14 19:31:12 +1000 |
commit | be64d43d01bd6cdad89fee1db0e3b559d97cef96 (patch) | |
tree | c797a10cd0650853e70a8ad8103b160c5eafeffd | |
parent | d6ead282dbf346f9037f6f8aa370c7ebbfbb5c62 (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-- | ChangeLog | 7 | ||||
-rw-r--r-- | monitor.c | 19 |
2 files changed, 24 insertions, 2 deletions
@@ -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 $ |
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor.c,v 1.39 2003/05/14 02:15:47 markus Exp $"); | 28 | RCSID("$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; | |||
143 | static char *auth_method = "unknown"; | 143 | static char *auth_method = "unknown"; |
144 | static int session_id2_len = 0; | 144 | static int session_id2_len = 0; |
145 | static u_char *session_id2 = NULL; | 145 | static u_char *session_id2 = NULL; |
146 | static pid_t monitor_child_pid; | ||
146 | 147 | ||
147 | struct mon_table { | 148 | struct 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 | ||
325 | static void | ||
326 | monitor_set_child_handler(pid_t pid) | ||
327 | { | ||
328 | monitor_child_pid = pid; | ||
329 | } | ||
330 | |||
331 | static void | ||
332 | monitor_child_handler(int signal) | ||
333 | { | ||
334 | kill(monitor_child_pid, signal); | ||
335 | } | ||
336 | |||
324 | void | 337 | void |
325 | monitor_child_postauth(struct monitor *pmonitor) | 338 | monitor_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 | ||