summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authordjm <djm>2007-09-17 01:58:04 +0000
committerdjm <djm>2007-09-17 01:58:04 +0000
commit42b4032276bb3f858f6b48cbe3ac207698dd1e85 (patch)
treede0716ba38086e344a807bcf568577a37f8e5a57 /sshconnect.c
parent5e206c6f91c8d5d7d6118847a656e7910f7a5440 (diff)
downloadopenssh-42b4032276bb3f858f6b48cbe3ac207698dd1e85.tar.gz
- 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 a222233d..7e3c9fff 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;