diff options
author | Damien Miller <djm@mindrot.org> | 2010-10-07 13:07:32 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-10-07 13:07:32 +0200 |
commit | a41ccca643364b3b1b65d7a818577dd35360fa20 (patch) | |
tree | cfcd6f4c1696af7bc514e6835d08d6ccbcfb8974 /sshconnect.c | |
parent | - djm@cvs.openbsd.org 2010/10/05 05:13:18 (diff) | |
download | openssh-a41ccca643364b3b1b65d7a818577dd35360fa20.tar.xz openssh-a41ccca643364b3b1b65d7a818577dd35360fa20.zip |
- djm@cvs.openbsd.org 2010/10/06 06:39:28
[clientloop.c ssh.c sshconnect.c sshconnect.h]
kill proxy command on fatal() (we already kill it on clean exit);
ok markus@
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 @@ -/* $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 @@ -66,12 +66,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 *); @@ -167,6 +168,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. */ |