Revert r1699914 (try use reverse DNS to resolve canonical name for SPN). While
the new behavior fixes issue with NTLM authentication to localhost, it may
break common existing setups [1]. This change restores previous behavior that
has been in serf 1.3.x.
[1] https://groups.google.com/forum/#!msg/serf-dev/yFPCis1zNNI/jQSUOd6StvgJ
git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1831196 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/auth/auth_spnego_sspi.c b/auth/auth_spnego_sspi.c
index cfaf3f7..0310492 100644
--- a/auth/auth_spnego_sspi.c
+++ b/auth/auth_spnego_sspi.c
@@ -174,23 +174,7 @@
}
if (addrinfo) {
- /* We got the canonical name and address. Try to perform
- * reverse DNS lookup to find the true hostname.
- * This is how MIT KRB works by default.*/
- char rdnshost[NI_MAXHOST];
- int gaierr;
-
- gaierr = getnameinfo(addrinfo->ai_addr, addrinfo->ai_addrlen,
- rdnshost, sizeof(rdnshost),
- NULL, 0, NI_NAMEREQD);
- if (gaierr) {
- /* Reverse DNS lookup failed -- use canonical name is that case. */
- *canonname = apr_pstrdup(pool, addrinfo->ai_canonname);
- }
- else {
- /* We got the hostname -- use it for SPN. */
- *canonname = apr_pstrdup(pool, rdnshost);
- }
+ *canonname = apr_pstrdup(pool, addrinfo->ai_canonname);
}
else {
*canonname = apr_pstrdup(pool, hostname);