summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-10-24 21:03:17 +1100
committerDamien Miller <djm@mindrot.org>2013-10-24 21:03:17 +1100
commita90c0338083ee0e4064c4bdf61f497293a699be0 (patch)
treefd77578aff45ce3bb9c77f114e082b412f04342d
parentcf31f3863425453ffcda540fbefa9df80088c8d1 (diff)
- djm@cvs.openbsd.org 2013/10/24 08:19:36
[ssh.c] fix bug introduced in hostname canonicalisation commit: don't try to resolve hostnames when a ProxyCommand is set unless the user has forced canonicalisation; spotted by Iain Morgan
-rw-r--r--ChangeLog5
-rw-r--r--ssh.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8dcff45d3..b4bbea167 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,11 @@
18 [readconf.c servconf.c ssh_config.5 sshd_config.5] 18 [readconf.c servconf.c ssh_config.5 sshd_config.5]
19 Disallow empty Match statements and add "Match all" which matches 19 Disallow empty Match statements and add "Match all" which matches
20 everything. ok djm, man page help jmc@ 20 everything. ok djm, man page help jmc@
21 - djm@cvs.openbsd.org 2013/10/24 08:19:36
22 [ssh.c]
23 fix bug introduced in hostname canonicalisation commit: don't try to
24 resolve hostnames when a ProxyCommand is set unless the user has forced
25 canonicalisation; spotted by Iain Morgan
21 26
2220131023 2720131023
23 - (djm) OpenBSD CVS Sync 28 - (djm) OpenBSD CVS Sync
diff --git a/ssh.c b/ssh.c
index 11fdb309d..81921a10d 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.389 2013/10/23 03:05:19 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.390 2013/10/24 08:19:36 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
@@ -913,9 +913,11 @@ main(int ac, char **av)
913 /* 913 /*
914 * If canonicalization not requested, or if it failed then try to 914 * If canonicalization not requested, or if it failed then try to
915 * resolve the bare hostname name using the system resolver's usual 915 * resolve the bare hostname name using the system resolver's usual
916 * search rules. 916 * search rules. Skip the lookup if a ProxyCommand is being used
917 * unless the user has specifically requested canonicalisation.
917 */ 918 */
918 if (addrs == NULL) { 919 if (addrs == NULL && (options.proxy_command == NULL ||
920 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) {
919 if ((addrs = resolve_host(host, options.port, 1, 921 if ((addrs = resolve_host(host, options.port, 1,
920 cname, sizeof(cname))) == NULL) 922 cname, sizeof(cname))) == NULL)
921 cleanup_exit(255); /* resolve_host logs the error */ 923 cleanup_exit(255); /* resolve_host logs the error */