mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libsmb: Remove unused ads_dns_query_* routines
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Dec 11 19:30:16 UTC 2020 on sn-devel-184
This commit is contained in:
parent
d327f664cc
commit
4925692599
@ -780,168 +780,3 @@ fail:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query with optional sitename.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
|
|
||||||
const char *servicename,
|
|
||||||
const char *dc_pdc_gc_domains,
|
|
||||||
const char *realm,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
NTSTATUS status;
|
|
||||||
size_t num_srvs = 0;
|
|
||||||
|
|
||||||
if ((sitename != NULL) && (strlen(sitename) != 0)) {
|
|
||||||
name = talloc_asprintf(ctx, "%s._tcp.%s._sites.%s._msdcs.%s",
|
|
||||||
servicename, sitename,
|
|
||||||
dc_pdc_gc_domains, realm);
|
|
||||||
if (name == NULL) {
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = ads_dns_lookup_srv(ctx, name, dclist, &num_srvs);
|
|
||||||
|
|
||||||
TALLOC_FREE(name);
|
|
||||||
|
|
||||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
|
||||||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NT_STATUS_IS_OK(status) && (num_srvs != 0)) {
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
name = talloc_asprintf(ctx, "%s._tcp.%s._msdcs.%s",
|
|
||||||
servicename, dc_pdc_gc_domains, realm);
|
|
||||||
if (name == NULL) {
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
status = ads_dns_lookup_srv(ctx, name, dclist, &num_srvs);
|
|
||||||
|
|
||||||
done:
|
|
||||||
*numdcs = num_srvs;
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query for AD DC's.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
|
|
||||||
const char *realm,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
|
|
||||||
status = ads_dns_query_internal(ctx,
|
|
||||||
"_ldap",
|
|
||||||
"dc",
|
|
||||||
realm,
|
|
||||||
sitename,
|
|
||||||
dclist,
|
|
||||||
numdcs);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query for AD GC's.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
|
|
||||||
const char *realm,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
|
|
||||||
status = ads_dns_query_internal(ctx,
|
|
||||||
"_ldap",
|
|
||||||
"gc",
|
|
||||||
realm,
|
|
||||||
sitename,
|
|
||||||
dclist,
|
|
||||||
numdcs);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query for AD KDC's.
|
|
||||||
Even if our underlying kerberos libraries are UDP only, this
|
|
||||||
is pretty safe as it's unlikely that a KDC supports TCP and not UDP.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_forest_name,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
|
|
||||||
status = ads_dns_query_internal(ctx,
|
|
||||||
"_kerberos",
|
|
||||||
"dc",
|
|
||||||
dns_forest_name,
|
|
||||||
sitename,
|
|
||||||
dclist,
|
|
||||||
numdcs);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query for AD PDC. Sitename is obsolete here.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_domain_name,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
return ads_dns_query_internal(ctx,
|
|
||||||
"_ldap",
|
|
||||||
"pdc",
|
|
||||||
dns_domain_name,
|
|
||||||
NULL,
|
|
||||||
dclist,
|
|
||||||
numdcs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
Query for AD DC by guid. Sitename is obsolete here.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_forest_name,
|
|
||||||
const char *domain_guid,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs )
|
|
||||||
{
|
|
||||||
/*_ldap._tcp.DomainGuid.domains._msdcs.DnsForestName */
|
|
||||||
|
|
||||||
const char *domains;
|
|
||||||
|
|
||||||
/* little hack */
|
|
||||||
domains = talloc_asprintf(ctx, "%s.domains", domain_guid);
|
|
||||||
if (!domains) {
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ads_dns_query_internal(ctx,
|
|
||||||
"_ldap",
|
|
||||||
domains,
|
|
||||||
dns_forest_name,
|
|
||||||
NULL,
|
|
||||||
dclist,
|
|
||||||
numdcs);
|
|
||||||
}
|
|
||||||
|
@ -81,28 +81,4 @@ NTSTATUS ads_dns_lookup_aaaa(TALLOC_CTX *ctx,
|
|||||||
struct samba_sockaddr **addrs_out);
|
struct samba_sockaddr **addrs_out);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
|
|
||||||
const char *realm,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs );
|
|
||||||
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
|
|
||||||
const char *realm,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs );
|
|
||||||
NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_forest_name,
|
|
||||||
const char *sitename,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs );
|
|
||||||
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_domain_name,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs );
|
|
||||||
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
|
|
||||||
const char *dns_forest_name,
|
|
||||||
const char *domain_guid,
|
|
||||||
struct dns_rr_srv **dclist,
|
|
||||||
size_t *numdcs );
|
|
||||||
#endif /* __LIB_ADDNS_DNSQUERY_H__ */
|
#endif /* __LIB_ADDNS_DNSQUERY_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user