summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--clientloop.c3
-rw-r--r--ssh.c13
-rw-r--r--sshconnect.c16
-rw-r--r--sshconnect.h3
5 files changed, 25 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index f5253a431..69711b9b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
3420100924 3820100924
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}
diff --git a/ssh.c b/ssh.c
index 20de28a64..7632cf51e 100644
--- a/ssh.c
+++ b/ssh.c
@@ -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 */
184static int remote_forward_confirms_received = 0; 184static int remote_forward_confirms_received = 0;
185 185
186/* pid of proxycommand child process */
187pid_t proxy_command_pid = 0;
188
189/* mux.c */ 186/* mux.c */
190extern int muxserver_sock; 187extern int muxserver_sock;
191extern u_int muxclient_command; 188extern 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
67static int matching_host_key_dns = 0; 67static int matching_host_key_dns = 0;
68 68
69static pid_t proxy_command_pid = 0;
70
69/* import */ 71/* import */
70extern Options options; 72extern Options options;
71extern char *__progname; 73extern char *__progname;
72extern uid_t original_real_uid; 74extern uid_t original_real_uid;
73extern uid_t original_effective_uid; 75extern uid_t original_effective_uid;
74extern pid_t proxy_command_pid;
75 76
76static int show_other_keys(const char *, Key *); 77static int show_other_keys(const char *, Key *);
77static void warn_changed_key(Key *); 78static 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
171void
172ssh_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 {
34int 34int
35ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int, 35ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int,
36 int *, int, int, const char *); 36 int *, int, int, const char *);
37void ssh_kill_proxy_command(void);
37 38
38void 39void
39ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *, int); 40ssh_login(Sensitive *, const char *, struct sockaddr *, struct passwd *, int);