diff options
-rw-r--r-- | readconf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c index 9e597748c..a810736a4 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.332 2020/07/05 23:59:45 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.333 2020/07/17 07:09:24 dtucker 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 |
@@ -664,7 +664,7 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, | |||
664 | if (r == (negate ? 1 : 0)) | 664 | if (r == (negate ? 1 : 0)) |
665 | this_result = result = 0; | 665 | this_result = result = 0; |
666 | } else if (strcasecmp(attrib, "exec") == 0) { | 666 | } else if (strcasecmp(attrib, "exec") == 0) { |
667 | char *conn_hash_hex; | 667 | char *conn_hash_hex, *keyalias; |
668 | 668 | ||
669 | if (gethostname(thishost, sizeof(thishost)) == -1) | 669 | if (gethostname(thishost, sizeof(thishost)) == -1) |
670 | fatal("gethostname: %s", strerror(errno)); | 670 | fatal("gethostname: %s", strerror(errno)); |
@@ -675,12 +675,15 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, | |||
675 | (unsigned long long)pw->pw_uid); | 675 | (unsigned long long)pw->pw_uid); |
676 | conn_hash_hex = ssh_connection_hash(thishost, host, | 676 | conn_hash_hex = ssh_connection_hash(thishost, host, |
677 | portstr, ruser); | 677 | portstr, ruser); |
678 | keyalias = options->host_key_alias ? | ||
679 | options->host_key_alias : host; | ||
678 | 680 | ||
679 | cmd = percent_expand(arg, | 681 | cmd = percent_expand(arg, |
680 | "C", conn_hash_hex, | 682 | "C", conn_hash_hex, |
681 | "L", shorthost, | 683 | "L", shorthost, |
682 | "d", pw->pw_dir, | 684 | "d", pw->pw_dir, |
683 | "h", host, | 685 | "h", host, |
686 | "k", keyalias, | ||
684 | "l", thishost, | 687 | "l", thishost, |
685 | "n", original_host, | 688 | "n", original_host, |
686 | "p", portstr, | 689 | "p", portstr, |