diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-07-17 03:43:42 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-07-17 13:52:46 +1000 |
commit | 8df5774a42d2eaffe057bd7f293fc6a4b1aa411c (patch) | |
tree | 16e1028b667e7f3fc41034da48367165e1110741 /sshconnect.c | |
parent | c4f239944a4351810fd317edf408bdcd5c0102d9 (diff) |
upstream: Add a '%k' TOKEN that expands to the effective HostKey of
the destination. This allows, eg, keeping host keys in individual files
using "UserKnownHostsFile ~/.ssh/known_hosts.d/%k". bz#1654, ok djm@, jmc@
(man page bits)
OpenBSD-Commit-ID: 7084d723c9cc987a5c47194219efd099af5beadc
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sshconnect.c b/sshconnect.c index af08be41..f6d8a1bc 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.329 2020/03/13 04:01:56 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.330 2020/07/17 03:43:42 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -89,11 +89,14 @@ expand_proxy_command(const char *proxy_command, const char *user, const char *host, const char *host_arg, int port) { char *tmp, *ret, strport[NI_MAXSERV]; + const char *keyalias = options.host_key_alias ? + options.host_key_alias : host_arg; snprintf(strport, sizeof strport, "%d", port); xasprintf(&tmp, "exec %s", proxy_command); ret = percent_expand(tmp, "h", host, + "k", keyalias, "n", host_arg, "p", strport, "r", options.user, |