From 507817881c734706b0287a9eaa9c10d7b61ff7cb Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Wed, 3 Jun 2015 13:50:25 +0300 Subject: [PATCH] namequery: fix get_kdc_list() to look for _kerberos records 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 Reviewed-by: Jeremy Allison Reviewed-by: Alexander Bokovoy --- source3/libsmb/namequery.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 07c58fc68c1..54bc79f254d 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -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; } -- 2.47.3