summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshconnect.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-10-06 06:39:28 +0000
committerdjm <djm@openbsd.org>2010-10-06 06:39:28 +0000
commita0818857133278c49ff8c8d0eb5cbaf016646192 (patch)
tree251360200214c6c246c1d7039a97f8e798312277 /usr.bin/ssh/sshconnect.c
parentSkip NULL entries in the sessions list when choosing the next session, (diff)
downloadwireguard-openbsd-a0818857133278c49ff8c8d0eb5cbaf016646192.tar.xz
wireguard-openbsd-a0818857133278c49ff8c8d0eb5cbaf016646192.zip
kill proxy command on fatal() (we already kill it on clean exit);
ok markus@
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
-rw-r--r--usr.bin/ssh/sshconnect.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 540e685d997..919e787fe0d 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.226 2010/10/05 05:13:18 djm Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.227 2010/10/06 06:39:28 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -57,12 +57,13 @@ char *server_version_string = NULL;
static int matching_host_key_dns = 0;
+static pid_t proxy_command_pid = 0;
+
/* import */
extern Options options;
extern char *__progname;
extern uid_t original_real_uid;
extern uid_t original_effective_uid;
-extern pid_t proxy_command_pid;
static int show_other_keys(const char *, Key *);
static void warn_changed_key(Key *);
@@ -158,6 +159,17 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
return 0;
}
+void
+ssh_kill_proxy_command(void)
+{
+ /*
+ * Send SIGHUP to proxy command if used. We don't wait() in
+ * case it hangs and instead rely on init to reap the child
+ */
+ if (proxy_command_pid > 1)
+ kill(SIGHUP, proxy_command_pid);
+}
+
/*
* Creates a (possibly privileged) socket for use as the ssh connection.
*/