summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-09-17 11:58:04 +1000
committerDamien Miller <djm@mindrot.org>2007-09-17 11:58:04 +1000
commit1d824ab2e72daf8563f6dc72f4b3638da3b91dce (patch)
treee318872a34f43a7d096181ff81ad23c6825296d6 /sshconnect.c
parent4890e539774ab8b57aa0ee733a5b07bdf9561af6 (diff)
- djm@cvs.openbsd.org 2007/08/23 03:23:26
[sshconnect.c] Execute ProxyCommands with $SHELL rather than /bin/sh unconditionally
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sshconnect.c b/sshconnect.c
index a222233d0..7e3c9fff4 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.200 2006/10/10 10:12:45 markus Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.201 2007/08/23 03:23:26 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -86,7 +86,10 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
char *command_string, *tmp;
int pin[2], pout[2];
pid_t pid;
- char strport[NI_MAXSERV];
+ char *shell, strport[NI_MAXSERV];
+
+ if ((shell = getenv("SHELL")) == NULL)
+ shell = _PATH_BSHELL;
/* Convert the port number into a string. */
snprintf(strport, sizeof strport, "%hu", port);
@@ -132,7 +135,7 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
/* Stderr is left as it is so that error messages get
printed on the user's terminal. */
- argv[0] = _PATH_BSHELL;
+ argv[0] = shell;
argv[1] = "-c";
argv[2] = command_string;
argv[3] = NULL;