From: Jeremy Allison Date: Wed, 26 Aug 2020 19:01:18 +0000 (-0700) Subject: s3: libsmb: Remove get_sorted_dc_list(). X-Git-Tag: talloc-2.3.2~616 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0984e5064216edafe4b83011dc1042ca64d5194;p=thirdparty%2Fsamba.git s3: libsmb: Remove get_sorted_dc_list(). No more callers. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 3d35c9d4cb6..0f8e75331ba 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -3962,57 +3962,6 @@ static NTSTATUS get_dc_list(const char *domain, return status; } -/********************************************************************* - Small wrapper function to get the DC list and sort it if neccessary. -*********************************************************************/ - -NTSTATUS get_sorted_dc_list( const char *domain, - const char *sitename, - struct ip_service **ip_list, - int *count, - bool ads_only ) -{ - bool ordered = false; - NTSTATUS status; - enum dc_lookup_type lookup_type = DC_NORMAL_LOOKUP; - - *ip_list = NULL; - *count = 0; - - DEBUG(8,("get_sorted_dc_list: attempting lookup " - "for name %s (sitename %s)\n", - domain, - sitename ? sitename : "NULL")); - - if (ads_only) { - lookup_type = DC_ADS_ONLY; - } - - status = get_dc_list(domain, sitename, ip_list, - count, lookup_type, &ordered); - if (NT_STATUS_EQUAL(status, NT_STATUS_NO_LOGON_SERVERS) - && sitename) { - DEBUG(3,("get_sorted_dc_list: no server for name %s available" - " in site %s, fallback to all servers\n", - domain, sitename)); - status = get_dc_list(domain, NULL, ip_list, - count, lookup_type, &ordered); - } - - if (!NT_STATUS_IS_OK(status)) { - SAFE_FREE(*ip_list); - *count = 0; - return status; - } - - /* only sort if we don't already have an ordered list */ - if (!ordered) { - sort_service_list(*ip_list, *count); - } - - return NT_STATUS_OK; -} - /********************************************************************* Talloc version. Small wrapper function to get the DC list and sort it if neccessary. diff --git a/source3/libsmb/namequery.h b/source3/libsmb/namequery.h index 9c4b2ecdf45..1eb3f86f3c3 100644 --- a/source3/libsmb/namequery.h +++ b/source3/libsmb/namequery.h @@ -109,11 +109,6 @@ NTSTATUS resolve_name_list(TALLOC_CTX *ctx, unsigned int *p_num_entries); bool find_master_ip(const char *group, struct sockaddr_storage *master_ss); bool get_pdc_ip(const char *domain, struct sockaddr_storage *pss); -NTSTATUS get_sorted_dc_list( const char *domain, - const char *sitename, - struct ip_service **ip_list, - int *count, - bool ads_only ); NTSTATUS get_sorted_dc_list_talloc(TALLOC_CTX *ctx, const char *domain, const char *sitename,