diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | clientloop.c | 3 | ||||
-rw-r--r-- | ssh.c | 13 | ||||
-rw-r--r-- | sshconnect.c | 16 | ||||
-rw-r--r-- | sshconnect.h | 3 |
5 files changed, 25 insertions, 14 deletions
@@ -30,6 +30,10 @@ | |||
30 | - djm@cvs.openbsd.org 2010/10/05 05:13:18 | 30 | - djm@cvs.openbsd.org 2010/10/05 05:13:18 |
31 | [sftp.c sshconnect.c] | 31 | [sftp.c sshconnect.c] |
32 | use default shell /bin/sh if $SHELL is ""; ok markus@ | 32 | use default shell /bin/sh if $SHELL is ""; ok markus@ |
33 | - djm@cvs.openbsd.org 2010/10/06 06:39:28 | ||
34 | [clientloop.c ssh.c sshconnect.c sshconnect.h] | ||
35 | kill proxy command on fatal() (we already kill it on clean exit); | ||
36 | ok markus@ | ||
33 | 37 | ||
34 | 20100924 | 38 | 20100924 |
35 | - (djm) OpenBSD CVS Sync | 39 | - (djm) OpenBSD CVS Sync |
diff --git a/clientloop.c b/clientloop.c index de7979366..848aacd4a 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.222 2010/07/19 09:15:12 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.223 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 |
@@ -2129,5 +2129,6 @@ cleanup_exit(int i) | |||
2129 | leave_non_blocking(); | 2129 | leave_non_blocking(); |
2130 | if (options.control_path != NULL && muxserver_sock != -1) | 2130 | if (options.control_path != NULL && muxserver_sock != -1) |
2131 | unlink(options.control_path); | 2131 | unlink(options.control_path); |
2132 | ssh_kill_proxy_command(); | ||
2132 | _exit(i); | 2133 | _exit(i); |
2133 | } | 2134 | } |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.352 2010/09/20 04:41:47 djm Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.353 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 |
@@ -183,9 +183,6 @@ int subsystem_flag = 0; | |||
183 | /* # of replies received for global requests */ | 183 | /* # of replies received for global requests */ |
184 | static int remote_forward_confirms_received = 0; | 184 | static int remote_forward_confirms_received = 0; |
185 | 185 | ||
186 | /* pid of proxycommand child process */ | ||
187 | pid_t proxy_command_pid = 0; | ||
188 | |||
189 | /* mux.c */ | 186 | /* mux.c */ |
190 | extern int muxserver_sock; | 187 | extern int muxserver_sock; |
191 | extern u_int muxclient_command; | 188 | extern u_int muxclient_command; |
@@ -921,12 +918,8 @@ main(int ac, char **av) | |||
921 | if (options.control_path != NULL && muxserver_sock != -1) | 918 | if (options.control_path != NULL && muxserver_sock != -1) |
922 | unlink(options.control_path); | 919 | unlink(options.control_path); |
923 | 920 | ||
924 | /* | 921 | /* Kill ProxyCommand if it is running. */ |
925 | * Send SIGHUP to proxy command if used. We don't wait() in | 922 | ssh_kill_proxy_command(); |
926 | * case it hangs and instead rely on init to reap the child | ||
927 | */ | ||
928 | if (proxy_command_pid > 1) | ||
929 | kill(proxy_command_pid, SIGHUP); | ||
930 | 923 | ||
931 | return exit_status; | 924 | return exit_status; |
932 | } | 925 | } |
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 | */ |
diff --git a/sshconnect.h b/sshconnect.h index c59a097f4..69163afbc 100644 --- a/sshconnect.h +++ b/sshconnect.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.h,v 1.25 2009/05/27 06:38:16 andreas Exp $ */ | 1 | /* $OpenBSD: sshconnect.h,v 1.26 2010/10/06 06:39:28 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -34,6 +34,7 @@ struct Sensitive { | |||
34 | int | 34 | int |
35 | ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int, | 35 | ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int, |
36 | int *, int, int, const char *); | 36 | int *, int, int, const char *); |
37 | void ssh_kill_proxy_command(void); | ||
37 | 38 | ||
38 | void | 39 | void |
39 | ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *, int); | 40 | ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *, int); |