diff options
author | Damien Miller <djm@mindrot.org> | 2011-01-07 09:51:17 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2011-01-07 09:51:17 +1100 |
commit | 83f8a4014d1818687f4e0ab36d1d388abac78863 (patch) | |
tree | 6528a3df7789e42f7105bf78160fab8119b526b0 | |
parent | 322125b9603cab2c70e827ae83d332cb6575e399 (diff) |
- djm@cvs.openbsd.org 2011/01/06 22:23:53
[ssh.c]
unbreak %n expansion in LocalCommand; patch from bert.wesarg AT
googlemail.com; ok markus@
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ssh.c | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -1,6 +1,10 @@ | |||
1 | 20110107 | 1 | 20110107 |
2 | - (djm) [regress/cert-hostkey.sh regress/cert-userkey.sh] fix shell test | 2 | - (djm) [regress/cert-hostkey.sh regress/cert-userkey.sh] fix shell test |
3 | for no-ECC case. Patch from cristian.ionescu-idbohrn AT axis.com | 3 | for no-ECC case. Patch from cristian.ionescu-idbohrn AT axis.com |
4 | - djm@cvs.openbsd.org 2011/01/06 22:23:53 | ||
5 | [ssh.c] | ||
6 | unbreak %n expansion in LocalCommand; patch from bert.wesarg AT | ||
7 | googlemail.com; ok markus@ | ||
4 | 8 | ||
5 | 20110106 | 9 | 20110106 |
6 | - (djm) OpenBSD CVS Sync | 10 | - (djm) OpenBSD CVS Sync |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.355 2010/11/29 23:45:51 djm Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.356 2011/01/06 22:23:53 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 |
@@ -221,7 +221,7 @@ int | |||
221 | main(int ac, char **av) | 221 | main(int ac, char **av) |
222 | { | 222 | { |
223 | int i, r, opt, exit_status, use_syslog; | 223 | int i, r, opt, exit_status, use_syslog; |
224 | char *p, *cp, *line, *argv0, buf[MAXPATHLEN]; | 224 | char *p, *cp, *line, *argv0, buf[MAXPATHLEN], *host_arg; |
225 | struct stat st; | 225 | struct stat st; |
226 | struct passwd *pw; | 226 | struct passwd *pw; |
227 | int dummy, timeout_ms; | 227 | int dummy, timeout_ms; |
@@ -693,6 +693,8 @@ main(int ac, char **av) | |||
693 | options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT; | 693 | options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT; |
694 | } | 694 | } |
695 | 695 | ||
696 | /* preserve host name given on command line for %n expansion */ | ||
697 | host_arg = host; | ||
696 | if (options.hostname != NULL) { | 698 | if (options.hostname != NULL) { |
697 | host = percent_expand(options.hostname, | 699 | host = percent_expand(options.hostname, |
698 | "h", host, (char *)NULL); | 700 | "h", host, (char *)NULL); |
@@ -707,7 +709,7 @@ main(int ac, char **av) | |||
707 | debug3("expanding LocalCommand: %s", options.local_command); | 709 | debug3("expanding LocalCommand: %s", options.local_command); |
708 | cp = options.local_command; | 710 | cp = options.local_command; |
709 | options.local_command = percent_expand(cp, "d", pw->pw_dir, | 711 | options.local_command = percent_expand(cp, "d", pw->pw_dir, |
710 | "h", host, "l", thishost, "n", host, "r", options.user, | 712 | "h", host, "l", thishost, "n", host_arg, "r", options.user, |
711 | "p", buf, "u", pw->pw_name, (char *)NULL); | 713 | "p", buf, "u", pw->pw_name, (char *)NULL); |
712 | debug3("expanded LocalCommand: %s", options.local_command); | 714 | debug3("expanded LocalCommand: %s", options.local_command); |
713 | xfree(cp); | 715 | xfree(cp); |