diff -up openssh-5.3p1/sshconnect2.c.canohost openssh-5.3p1/sshconnect2.c --- openssh-5.3p1/sshconnect2.c.canohost 2009-03-05 14:58:22.000000000 +0100 +++ openssh-5.3p1/sshconnect2.c 2009-11-02 11:55:00.000000000 +0100 @@ -542,6 +542,12 @@ userauth_gssapi(Authctxt *authctxt) static u_int mech = 0; OM_uint32 min; int ok = 0; + char* remotehost = NULL; + const char* canonicalhost = get_canonical_hostname(1); + if ( strcmp( canonicalhost, "UNKNOWN" ) == 0 ) + remotehost = authctxt->host; + else + remotehost = canonicalhost; /* Try one GSSAPI method at a time, rather than sending them all at * once. */ @@ -554,7 +560,7 @@ userauth_gssapi(Authctxt *authctxt) /* My DER encoding requires length<128 */ if (gss_supported->elements[mech].length < 128 && ssh_gssapi_check_mechanism(&gssctxt, - &gss_supported->elements[mech], authctxt->host)) { + &gss_supported->elements[mech], remotehost)) { ok = 1; /* Mechanism works */ } else { mech++;