summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2013-10-24 08:19:36 +0000
committerdjm <djm@openbsd.org>2013-10-24 08:19:36 +0000
commit0c72474339e6f83d3779b4ee7704217a93c8b44c (patch)
tree99c00c98be76f83644481a71900a431519b29a44 /usr.bin/ssh/ssh.c
parentAlign suseconds_t with POSIX: it's the type of the tv_usec member of timeval. (diff)
downloadwireguard-openbsd-0c72474339e6f83d3779b4ee7704217a93c8b44c.tar.xz
wireguard-openbsd-0c72474339e6f83d3779b4ee7704217a93c8b44c.zip
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
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 32b73b784e7..9402157800c 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.389 2013/10/23 03:05:19 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.390 2013/10/24 08:19:36 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -881,9 +881,11 @@ main(int ac, char **av)
/*
* If canonicalization not requested, or if it failed then try to
* resolve the bare hostname name using the system resolver's usual
- * search rules.
+ * search rules. Skip the lookup if a ProxyCommand is being used
+ * unless the user has specifically requested canonicalisation.
*/
- if (addrs == NULL) {
+ if (addrs == NULL && (options.proxy_command == NULL ||
+ options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) {
if ((addrs = resolve_host(host, options.port, 1,
cname, sizeof(cname))) == NULL)
cleanup_exit(255); /* resolve_host logs the error */