vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F 003cb0
diff -up openssh-5.8p1/sshconnect2.c.canohost openssh-5.8p1/sshconnect2.c
Jan F 003cb0
--- openssh-5.8p1/sshconnect2.c.canohost	2011-02-14 15:15:15.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/sshconnect2.c	2011-02-14 15:21:45.000000000 +0100
Jan F 003cb0
@@ -697,14 +697,17 @@ userauth_gssapi(Authctxt *authctxt)
Jan F 003cb0
 	static u_int mech = 0;
Jan F 003cb0
 	OM_uint32 min;
Jan F 003cb0
 	int ok = 0;
Jan F 003cb0
-	const char *gss_host;
Jan F 003cb0
+	const char *gss_host = NULL;
Jan F 003cb0
 
Jan F 003cb0
 	if (options.gss_server_identity)
Jan F 003cb0
 		gss_host = options.gss_server_identity;
Jan F 003cb0
 	else if (options.gss_trust_dns)
Jan F 003cb0
 		gss_host = get_canonical_hostname(1);
Jan F 003cb0
-	else
Jan F 003cb0
-		gss_host = authctxt->host;
Jan F 003cb0
+	else {
Jan F 003cb0
+		gss_host = get_canonical_hostname(1);
Jan F 003cb0
+		if ( strcmp( gss_host, "UNKNOWN" )  == 0 )
Jan F 003cb0
+			gss_host = authctxt->host;
Jan F 003cb0
+	}
Jan F 003cb0
 
Jan F 003cb0
 	/* Try one GSSAPI method at a time, rather than sending them all at
Jan F 003cb0
 	 * once. */