diff options
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sshconnect.c b/sshconnect.c index 6d2f1341c..c849ca393 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.c,v 1.226 2010/10/05 05:13:18 djm Exp $ */ | 1 | /* $OpenBSD: sshconnect.c,v 1.227 2010/10/06 06:39:28 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -66,12 +66,13 @@ char *server_version_string = NULL; | |||
66 | 66 | ||
67 | static int matching_host_key_dns = 0; | 67 | static int matching_host_key_dns = 0; |
68 | 68 | ||
69 | static pid_t proxy_command_pid = 0; | ||
70 | |||
69 | /* import */ | 71 | /* import */ |
70 | extern Options options; | 72 | extern Options options; |
71 | extern char *__progname; | 73 | extern char *__progname; |
72 | extern uid_t original_real_uid; | 74 | extern uid_t original_real_uid; |
73 | extern uid_t original_effective_uid; | 75 | extern uid_t original_effective_uid; |
74 | extern pid_t proxy_command_pid; | ||
75 | 76 | ||
76 | static int show_other_keys(const char *, Key *); | 77 | static int show_other_keys(const char *, Key *); |
77 | static void warn_changed_key(Key *); | 78 | static void warn_changed_key(Key *); |
@@ -167,6 +168,17 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command) | |||
167 | return 0; | 168 | return 0; |
168 | } | 169 | } |
169 | 170 | ||
171 | void | ||
172 | ssh_kill_proxy_command(void) | ||
173 | { | ||
174 | /* | ||
175 | * Send SIGHUP to proxy command if used. We don't wait() in | ||
176 | * case it hangs and instead rely on init to reap the child | ||
177 | */ | ||
178 | if (proxy_command_pid > 1) | ||
179 | kill(SIGHUP, proxy_command_pid); | ||
180 | } | ||
181 | |||
170 | /* | 182 | /* |
171 | * Creates a (possibly privileged) socket for use as the ssh connection. | 183 | * Creates a (possibly privileged) socket for use as the ssh connection. |
172 | */ | 184 | */ |