summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c
index 2a5620479..69d4553af 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.249 2016/01/29 02:54:45 dtucker Exp $ */ 1/* $OpenBSD: readconf.c,v 1.250 2016/02/08 23:40:12 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
@@ -522,12 +522,15 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw,
522 */ 522 */
523 port = options->port <= 0 ? default_ssh_port() : options->port; 523 port = options->port <= 0 ? default_ssh_port() : options->port;
524 ruser = options->user == NULL ? pw->pw_name : options->user; 524 ruser = options->user == NULL ? pw->pw_name : options->user;
525 if (options->hostname != NULL) { 525 if (post_canon) {
526 host = xstrdup(options->hostname);
527 } else if (options->hostname != NULL) {
526 /* NB. Please keep in sync with ssh.c:main() */ 528 /* NB. Please keep in sync with ssh.c:main() */
527 host = percent_expand(options->hostname, 529 host = percent_expand(options->hostname,
528 "h", host_arg, (char *)NULL); 530 "h", host_arg, (char *)NULL);
529 } else 531 } else {
530 host = xstrdup(host_arg); 532 host = xstrdup(host_arg);
533 }
531 534
532 debug2("checking match for '%s' host %s originally %s", 535 debug2("checking match for '%s' host %s originally %s",
533 cp, host, original_host); 536 cp, host, original_host);