summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-04-14 22:27:42 +0000
committerdjm <djm@openbsd.org>2010-04-14 22:27:42 +0000
commitddcb42c28519eef1c40a14b05aeb44a77ccc5752 (patch)
tree122a5f6f0bd6a4d0bd5bd1179d64597548673753 /usr.bin/ssh
parentclean Sitecom run(4) ids. (diff)
downloadwireguard-openbsd-ddcb42c28519eef1c40a14b05aeb44a77ccc5752.tar.xz
wireguard-openbsd-ddcb42c28519eef1c40a14b05aeb44a77ccc5752.zip
expand %r => remote username in ssh_config:ProxyCommand;
ok deraadt markus
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/ssh_config.512
-rw-r--r--usr.bin/ssh/sshconnect.c6
2 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/ssh/ssh_config.5 b/usr.bin/ssh/ssh_config.5
index 2945e48b6d1..3f0f537a9d6 100644
--- a/usr.bin/ssh/ssh_config.5
+++ b/usr.bin/ssh/ssh_config.5
@@ -34,8 +34,8 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: ssh_config.5,v 1.131 2010/03/27 14:26:55 jmc Exp $
-.Dd $Mdocdate: March 27 2010 $
+.\" $OpenBSD: ssh_config.5,v 1.132 2010/04/14 22:27:42 djm Exp $
+.Dd $Mdocdate: April 14 2010 $
.Dt SSH_CONFIG 5
.Os
.Sh NAME
@@ -759,12 +759,14 @@ Specifies the command to use to connect to the server.
The command
string extends to the end of the line, and is executed with
the user's shell.
-In the command string,
+In the command string, any occurance of
.Ql %h
will be substituted by the host name to
-connect and
+connect,
.Ql %p
-by the port.
+by the port and
+.Ql %u
+by the remote user name.
The command can be basically anything,
and should read from its standard input and write to its standard output.
It should eventually connect an
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index d39bef1149b..3becf8fd524 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.221 2010/04/10 00:04:30 djm Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.222 2010/04/14 22:27:42 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -92,8 +92,8 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
* (e.g. Solaris)
*/
xasprintf(&tmp, "exec %s", proxy_command);
- command_string = percent_expand(tmp, "h", host,
- "p", strport, (char *)NULL);
+ command_string = percent_expand(tmp, "h", host, "p", strport,
+ "u", options.user, (char *)NULL);
xfree(tmp);
/* Create pipes for communicating with the proxy. */