diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2007-08-23 03:23:27 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2007-08-23 03:23:27 +0000 |
commit | 158c0680614628c6622cd688d9f51724e1596158 (patch) | |
tree | cb8ab8d81cd0ea8319313166587f867dafae1777 | |
parent | 66a3c51e3fb6a9252f1659ca301b30ea581b4e3e (diff) |
Execute ProxyCommands with $SHELL rather than /bin/sh unconditionally
-rw-r--r-- | usr.bin/ssh/sshconnect.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index 163f00fd397..cb0eeab0be7 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/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 @@ -73,7 +73,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); @@ -119,7 +122,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; |