summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-04-16 15:54:19 +1000
committerDamien Miller <djm@mindrot.org>2010-04-16 15:54:19 +1000
commitb1b17047e39b88f640a6e55141cd1073ee6e55e4 (patch)
tree72f2cd2a74e45dede6c78486f5aef57f54ce6817
parent601a23c02cb1612e9596f4ce7bfa261525363c5d (diff)
- djm@cvs.openbsd.org 2010/04/14 22:27:42
[ssh_config.5 sshconnect.c] expand %r => remote username in ssh_config:ProxyCommand; ok deraadt markus
-rw-r--r--ChangeLog4
-rw-r--r--ssh_config.512
-rw-r--r--sshconnect.c6
3 files changed, 14 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d3d2b788..afd69b039 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,10 @@
32 - djm@cvs.openbsd.org 2010/04/10 05:48:16 32 - djm@cvs.openbsd.org 2010/04/10 05:48:16
33 [mux.c] 33 [mux.c]
34 fix NULL dereference; from matthew.haub AT alumni.adelaide.edu.au 34 fix NULL dereference; from matthew.haub AT alumni.adelaide.edu.au
35 - djm@cvs.openbsd.org 2010/04/14 22:27:42
36 [ssh_config.5 sshconnect.c]
37 expand %r => remote username in ssh_config:ProxyCommand;
38 ok deraadt markus
35 39
3620100410 4020100410
37 - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo 41 - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo
diff --git a/ssh_config.5 b/ssh_config.5
index 2945e48b6..3f0f537a9 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -34,8 +34,8 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh_config.5,v 1.131 2010/03/27 14:26:55 jmc Exp $ 37.\" $OpenBSD: ssh_config.5,v 1.132 2010/04/14 22:27:42 djm Exp $
38.Dd $Mdocdate: March 27 2010 $ 38.Dd $Mdocdate: April 14 2010 $
39.Dt SSH_CONFIG 5 39.Dt SSH_CONFIG 5
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -759,12 +759,14 @@ Specifies the command to use to connect to the server.
759The command 759The command
760string extends to the end of the line, and is executed with 760string extends to the end of the line, and is executed with
761the user's shell. 761the user's shell.
762In the command string, 762In the command string, any occurance of
763.Ql %h 763.Ql %h
764will be substituted by the host name to 764will be substituted by the host name to
765connect and 765connect,
766.Ql %p 766.Ql %p
767by the port. 767by the port and
768.Ql %u
769by the remote user name.
768The command can be basically anything, 770The command can be basically anything,
769and should read from its standard input and write to its standard output. 771and should read from its standard input and write to its standard output.
770It should eventually connect an 772It should eventually connect an
diff --git a/sshconnect.c b/sshconnect.c
index effe6dae8..ca83bc792 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.221 2010/04/10 00:04:30 djm Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.222 2010/04/14 22:27:42 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -101,8 +101,8 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
101 * (e.g. Solaris) 101 * (e.g. Solaris)
102 */ 102 */
103 xasprintf(&tmp, "exec %s", proxy_command); 103 xasprintf(&tmp, "exec %s", proxy_command);
104 command_string = percent_expand(tmp, "h", host, 104 command_string = percent_expand(tmp, "h", host, "p", strport,
105 "p", strport, (char *)NULL); 105 "u", options.user, (char *)NULL);
106 xfree(tmp); 106 xfree(tmp);
107 107
108 /* Create pipes for communicating with the proxy. */ 108 /* Create pipes for communicating with the proxy. */