changeset 13566:b2b4f797c428

1848 sshd always tries to resolve client's IP to hostname Reviewed by: Andrew Stormont <Andrew.Stormont@nexenta.com> Reviewed by: Alexander Eremin <alexander.eremin@nexenta.com> Reviewed by: Dan Kruchinin <dkruchinin@acm.org> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Vitaliy Gusev <gusev.vitaliy@nexenta.com>
date Wed, 21 Dec 2011 22:55:37 +0300
parents fed8865d992e
children 3cb321bb3838
files usr/src/cmd/ssh/libssh/common/canohost.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/ssh/libssh/common/canohost.c	Mon Jan 16 17:58:43 2012 +0100
+++ b/usr/src/cmd/ssh/libssh/common/canohost.c	Wed Dec 21 22:55:37 2011 +0300
@@ -13,13 +13,13 @@
 /*
  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #include "includes.h"
 RCSID("$OpenBSD: canohost.c,v 1.34 2002/09/23 20:46:27 stevesk Exp $");
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include "packet.h"
 #include "xmalloc.h"
 #include "log.h"
@@ -65,6 +65,9 @@
 	}
 #endif /* IPV4_IN_IPV6 */
 
+	if (!verify_reverse_mapping)
+		return xstrdup(ntop);
+
 	debug3("Trying to reverse map address %.100s.", ntop);
 	/* Map the IP address to a host name. */
 	if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
@@ -86,8 +89,6 @@
 		if (isupper(name[i]))
 			name[i] = tolower(name[i]);
 
-	if (!verify_reverse_mapping)
-		return xstrdup(name);
 	/*
 	 * Map it back to an IP address and check that the given
 	 * address actually is an address of this host.  This is