]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
namequery: fix get_kdc_list() to look for _kerberos records
authorUri Simchoni <urisimchoni@gmail.com>
Wed, 3 Jun 2015 10:50:25 +0000 (13:50 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 15 Jun 2015 23:29:24 +0000 (01:29 +0200)
get_kdc_list() should look for _kerberos.xxx SRV records rather
than _ldap.xxx records. This has significance in two cases:
- Non-default DNS configurations
- When building a custom krb5.conf file for a domain, an attempt is
  made to get site-specific as well as site-less records, but the
  search for _ldap records yields a cached site-specific result even
  for the site-less query.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/libsmb/namequery.c

index 07c58fc68c1185805f4c2ee94c1c67f6e4e60c14..54bc79f254d3496ab065e0ea24a258f8c4a1a7e7 100644 (file)
@@ -3076,6 +3076,7 @@ static NTSTATUS get_dc_list(const char *domain,
        int auto_count = 0;
        NTSTATUS status;
        TALLOC_CTX *ctx = talloc_init("get_dc_list");
+       int auto_name_type = 0x1C;
 
        *ip_list = NULL;
        *count = 0;
@@ -3116,6 +3117,7 @@ static NTSTATUS get_dc_list(const char *domain,
                   are already sorted by priority and weight */
                *ordered = true;
                resolve_order = kdc_order;
+               auto_name_type = KDC_NAME_TYPE;
        }
 
        /* fetch the server we have affinity for.  Add the
@@ -3159,7 +3161,8 @@ static NTSTATUS get_dc_list(const char *domain,
        p = pserver;
        while (next_token_talloc(ctx, &p, &name, LIST_SEP)) {
                if (!done_auto_lookup && strequal(name, "*")) {
-                       status = internal_resolve_name(domain, 0x1C, sitename,
+                       status = internal_resolve_name(domain, auto_name_type,
+                                                      sitename,
                                                       &auto_ip_list,
                                                       &auto_count,
                                                       resolve_order);
@@ -3183,7 +3186,8 @@ static NTSTATUS get_dc_list(const char *domain,
                        status = NT_STATUS_NO_LOGON_SERVERS;
                        goto out;
                }
-               status = internal_resolve_name(domain, 0x1C, sitename, ip_list,
+               status = internal_resolve_name(domain, auto_name_type,
+                                              sitename, ip_list,
                                             count, resolve_order);
                goto out;
        }