mirror of
https://github.com/samba-team/samba.git
synced 2025-03-23 06:50:21 +03:00
addns: Remove support for dns_host_file.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
3ab2aa2511
commit
7f00fcf558
@ -390,7 +390,6 @@ static NTSTATUS dns_send_req( TALLOC_CTX *ctx, const char *name, int q_type,
|
||||
*********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *name,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs)
|
||||
@ -408,12 +407,6 @@ NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (dns_hosts_file) {
|
||||
return resolve_dns_hosts_file_as_dns_rr(dns_hosts_file,
|
||||
name, true, ctx,
|
||||
dclist, numdcs);
|
||||
}
|
||||
|
||||
/* Send the request. May have to loop several times in case
|
||||
of large replies */
|
||||
|
||||
@ -586,7 +579,6 @@ NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
|
||||
*********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dnsdomain,
|
||||
struct dns_rr_ns **nslist,
|
||||
int *numns)
|
||||
@ -604,11 +596,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (dns_hosts_file) {
|
||||
DEBUG(1, ("NO 'NS' lookup available when using resolv:host file"));
|
||||
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Send the request. May have to loop several times in case
|
||||
of large replies */
|
||||
|
||||
@ -747,7 +734,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
|
||||
********************************************************************/
|
||||
|
||||
static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *servicename,
|
||||
const char *dc_pdc_gc_domains,
|
||||
const char *realm,
|
||||
@ -767,7 +753,7 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
|
||||
if (!name) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
return ads_dns_lookup_srv(ctx, dns_hosts_file, name, dclist, numdcs);
|
||||
return ads_dns_lookup_srv(ctx, name, dclist, numdcs);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -775,7 +761,6 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
@ -783,74 +768,12 @@ NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "dc",
|
||||
realm, sitename, dclist, numdcs);
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (sitename &&
|
||||
((!NT_STATUS_IS_OK(status)) ||
|
||||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
|
||||
/* Sitename DNS query may have failed. Try without. */
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file,
|
||||
"_ldap", "dc", realm,
|
||||
NULL, dclist, numdcs);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Query for AD GC's.
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs )
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "gc",
|
||||
realm, sitename, dclist, numdcs);
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (sitename &&
|
||||
((!NT_STATUS_IS_OK(status)) ||
|
||||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
|
||||
/* Sitename DNS query may have failed. Try without. */
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file,
|
||||
"_ldap", "gc", realm,
|
||||
NULL, 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_hosts_file,
|
||||
const char *dns_forest_name,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs )
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file, "_kerberos", "dc",
|
||||
dns_forest_name, sitename, dclist,
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
"dc",
|
||||
realm,
|
||||
sitename,
|
||||
dclist,
|
||||
numdcs);
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
||||
@ -862,10 +785,95 @@ NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
|
||||
((!NT_STATUS_IS_OK(status)) ||
|
||||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
|
||||
/* Sitename DNS query may have failed. Try without. */
|
||||
status = ads_dns_query_internal(ctx, dns_hosts_file,
|
||||
"_kerberos", "dc",
|
||||
dns_forest_name, NULL,
|
||||
dclist, numdcs);
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
"dc",
|
||||
realm,
|
||||
NULL,
|
||||
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,
|
||||
int *numdcs )
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
"gc",
|
||||
realm,
|
||||
sitename,
|
||||
dclist,
|
||||
numdcs);
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (sitename &&
|
||||
((!NT_STATUS_IS_OK(status)) ||
|
||||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
|
||||
/* Sitename DNS query may have failed. Try without. */
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
"gc",
|
||||
realm,
|
||||
NULL,
|
||||
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,
|
||||
int *numdcs )
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_kerberos",
|
||||
"dc",
|
||||
dns_forest_name,
|
||||
sitename,
|
||||
dclist,
|
||||
numdcs);
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (sitename &&
|
||||
((!NT_STATUS_IS_OK(status)) ||
|
||||
(NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
|
||||
/* Sitename DNS query may have failed. Try without. */
|
||||
status = ads_dns_query_internal(ctx,
|
||||
"_kerberos",
|
||||
"dc",
|
||||
dns_forest_name,
|
||||
NULL,
|
||||
dclist,
|
||||
numdcs);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -875,13 +883,17 @@ NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dns_domain_name,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs )
|
||||
{
|
||||
return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "pdc",
|
||||
dns_domain_name, NULL, dclist, numdcs);
|
||||
return ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
"pdc",
|
||||
dns_domain_name,
|
||||
NULL,
|
||||
dclist,
|
||||
numdcs);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -889,7 +901,6 @@ NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
|
||||
********************************************************************/
|
||||
|
||||
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dns_forest_name,
|
||||
const char *domain_guid,
|
||||
struct dns_rr_srv **dclist,
|
||||
@ -905,6 +916,11 @@ NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", domains,
|
||||
dns_forest_name, NULL, dclist, numdcs);
|
||||
return ads_dns_query_internal(ctx,
|
||||
"_ldap",
|
||||
domains,
|
||||
dns_forest_name,
|
||||
NULL,
|
||||
dclist,
|
||||
numdcs);
|
||||
}
|
||||
|
@ -25,40 +25,33 @@
|
||||
/* The following definitions come from libads/dns.c */
|
||||
|
||||
NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *name,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs);
|
||||
NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dnsdomain,
|
||||
struct dns_rr_ns **nslist,
|
||||
int *numns);
|
||||
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs );
|
||||
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs );
|
||||
NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dns_forest_name,
|
||||
const char *sitename,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs );
|
||||
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dns_domain_name,
|
||||
struct dns_rr_srv **dclist,
|
||||
int *numdcs );
|
||||
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
|
||||
const char *dns_hosts_file,
|
||||
const char *dns_forest_name,
|
||||
const char *domain_guid,
|
||||
struct dns_rr_srv **dclist,
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
bld.SAMBA_LIBRARY('addns',
|
||||
source='dnsquery.c dnsrecord.c dnsutils.c dnssock.c dnsgss.c dnsmarshall.c error.c',
|
||||
public_deps='dnshostsfile samba-util gssapi ndr resolv',
|
||||
public_deps='samba-util gssapi ndr resolv',
|
||||
private_library=True,
|
||||
vars=locals())
|
||||
|
@ -539,7 +539,6 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads)
|
||||
int i;
|
||||
bool done = false;
|
||||
char *sitename = NULL;
|
||||
const char *dns_hosts_file;
|
||||
|
||||
if (!realm)
|
||||
realm = lp_realm();
|
||||
@ -549,7 +548,6 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads)
|
||||
sitename = sitename_fetch(frame, realm);
|
||||
}
|
||||
|
||||
dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
|
||||
do {
|
||||
/* We try once with a sitename and once without
|
||||
(unless we don't have a sitename and then we're
|
||||
@ -558,9 +556,11 @@ ADS_STATUS ads_connect_gc(ADS_STRUCT *ads)
|
||||
if (sitename == NULL)
|
||||
done = true;
|
||||
|
||||
nt_status = ads_dns_query_gcs(frame, dns_hosts_file,
|
||||
realm, sitename,
|
||||
&gcs_list, &num_gcs);
|
||||
nt_status = ads_dns_query_gcs(frame,
|
||||
realm,
|
||||
sitename,
|
||||
&gcs_list,
|
||||
&num_gcs);
|
||||
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
ads_status = ADS_ERROR_NT(nt_status);
|
||||
|
@ -547,39 +547,49 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
|
||||
int numaddrs = 0;
|
||||
struct ip_service_name *dclist = NULL;
|
||||
int count = 0;
|
||||
const char *dns_hosts_file;
|
||||
char *guid_string;
|
||||
|
||||
dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
|
||||
if (flags & DS_PDC_REQUIRED) {
|
||||
status = ads_dns_query_pdc(mem_ctx, dns_hosts_file,
|
||||
domain_name, &dcs, &numdcs);
|
||||
status = ads_dns_query_pdc(mem_ctx,
|
||||
domain_name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
} else if (flags & DS_GC_SERVER_REQUIRED) {
|
||||
status = ads_dns_query_gcs(mem_ctx, dns_hosts_file,
|
||||
domain_name, site_name,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_gcs(mem_ctx,
|
||||
domain_name,
|
||||
site_name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
} else if (flags & DS_KDC_REQUIRED) {
|
||||
status = ads_dns_query_kdcs(mem_ctx, dns_hosts_file,
|
||||
domain_name, site_name,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_kdcs(mem_ctx,
|
||||
domain_name,
|
||||
site_name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
} else if (flags & DS_DIRECTORY_SERVICE_REQUIRED) {
|
||||
status = ads_dns_query_dcs(mem_ctx, dns_hosts_file,
|
||||
domain_name, site_name,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_dcs(mem_ctx,
|
||||
domain_name,
|
||||
site_name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
} else if (domain_guid) {
|
||||
guid_string = GUID_string(mem_ctx, domain_guid);
|
||||
if (!guid_string) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
status = ads_dns_query_dcs_guid(mem_ctx, dns_hosts_file,
|
||||
domain_name, guid_string,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_dcs_guid(mem_ctx,
|
||||
domain_name,
|
||||
guid_string,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
TALLOC_FREE(guid_string);
|
||||
} else {
|
||||
status = ads_dns_query_dcs(mem_ctx, dns_hosts_file,
|
||||
domain_name, site_name,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_dcs(mem_ctx,
|
||||
domain_name,
|
||||
site_name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
}
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
@ -2424,7 +2424,6 @@ static NTSTATUS resolve_ads(const char *name,
|
||||
struct dns_rr_srv *dcs = NULL;
|
||||
int numdcs = 0;
|
||||
int numaddrs = 0;
|
||||
const char *dns_hosts_file;
|
||||
|
||||
if ((name_type != 0x1c) && (name_type != KDC_NAME_TYPE) &&
|
||||
(name_type != 0x1b)) {
|
||||
@ -2437,28 +2436,32 @@ static NTSTATUS resolve_ads(const char *name,
|
||||
}
|
||||
|
||||
/* The DNS code needs fixing to find IPv6 addresses... JRA. */
|
||||
|
||||
dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
|
||||
switch (name_type) {
|
||||
case 0x1b:
|
||||
DEBUG(5,("resolve_ads: Attempting to resolve "
|
||||
"PDC for %s using DNS\n", name));
|
||||
status = ads_dns_query_pdc(ctx, dns_hosts_file,
|
||||
name, &dcs, &numdcs);
|
||||
status = ads_dns_query_pdc(ctx,
|
||||
name,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
break;
|
||||
|
||||
case 0x1c:
|
||||
DEBUG(5,("resolve_ads: Attempting to resolve "
|
||||
"DCs for %s using DNS\n", name));
|
||||
status = ads_dns_query_dcs(ctx, dns_hosts_file,
|
||||
name, sitename, &dcs,
|
||||
status = ads_dns_query_dcs(ctx,
|
||||
name,
|
||||
sitename,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
break;
|
||||
case KDC_NAME_TYPE:
|
||||
DEBUG(5,("resolve_ads: Attempting to resolve "
|
||||
"KDCs for %s using DNS\n", name));
|
||||
status = ads_dns_query_kdcs(ctx, dns_hosts_file,
|
||||
name, sitename, &dcs,
|
||||
status = ads_dns_query_kdcs(ctx,
|
||||
name,
|
||||
sitename,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
break;
|
||||
default:
|
||||
|
@ -1143,7 +1143,6 @@ static NTSTATUS net_update_dns_internal(struct net_context *c,
|
||||
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
|
||||
DNS_ERROR dns_err;
|
||||
fstring dns_server;
|
||||
const char *dns_hosts_file;
|
||||
const char *dnsdomain = NULL;
|
||||
char *root_domain = NULL;
|
||||
|
||||
@ -1155,9 +1154,10 @@ static NTSTATUS net_update_dns_internal(struct net_context *c,
|
||||
}
|
||||
dnsdomain++;
|
||||
|
||||
dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
|
||||
status = ads_dns_lookup_ns(ctx, dns_hosts_file,
|
||||
dnsdomain, &nameservers, &ns_count);
|
||||
status = ads_dns_lookup_ns(ctx,
|
||||
dnsdomain,
|
||||
&nameservers,
|
||||
&ns_count);
|
||||
if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) {
|
||||
/* Child domains often do not have NS records. Look
|
||||
for the NS record for the forest root domain
|
||||
@ -1195,8 +1195,10 @@ static NTSTATUS net_update_dns_internal(struct net_context *c,
|
||||
|
||||
/* try again for NS servers */
|
||||
|
||||
status = ads_dns_lookup_ns(ctx, dns_hosts_file, root_domain,
|
||||
&nameservers, &ns_count);
|
||||
status = ads_dns_lookup_ns(ctx,
|
||||
root_domain,
|
||||
&nameservers,
|
||||
&ns_count);
|
||||
|
||||
if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) {
|
||||
DEBUG(3,("net_update_dns_internal: Failed to find name server for the %s "
|
||||
|
@ -106,7 +106,6 @@ static int net_lookup_ldap(struct net_context *c, int argc, const char **argv)
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
char h_name[MAX_DNS_NAME_LENGTH];
|
||||
const char *dns_hosts_file;
|
||||
|
||||
if (argc > 0)
|
||||
domain = argv[0];
|
||||
@ -123,9 +122,11 @@ static int net_lookup_ldap(struct net_context *c, int argc, const char **argv)
|
||||
|
||||
DEBUG(9, ("Lookup up ldap for domain %s\n", domain));
|
||||
|
||||
dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
|
||||
status = ads_dns_query_dcs(ctx, dns_hosts_file, domain, sitename,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_dcs(ctx,
|
||||
domain,
|
||||
sitename,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
if ( NT_STATUS_IS_OK(status) && numdcs ) {
|
||||
print_ldap_srvlist(dcs, numdcs);
|
||||
TALLOC_FREE( ctx );
|
||||
@ -159,8 +160,11 @@ static int net_lookup_ldap(struct net_context *c, int argc, const char **argv)
|
||||
|
||||
DEBUG(9, ("Looking up ldap for domain %s\n", domain));
|
||||
|
||||
status = ads_dns_query_dcs(ctx, dns_hosts_file, domain, sitename,
|
||||
&dcs, &numdcs);
|
||||
status = ads_dns_query_dcs(ctx,
|
||||
domain,
|
||||
sitename,
|
||||
&dcs,
|
||||
&numdcs);
|
||||
if ( NT_STATUS_IS_OK(status) && numdcs ) {
|
||||
print_ldap_srvlist(dcs, numdcs);
|
||||
TALLOC_FREE( ctx );
|
||||
|
@ -278,7 +278,7 @@ static struct dns_records_container get_srv_records(TALLOC_CTX *mem_ctx,
|
||||
memset(&ret, 0, sizeof(struct dns_records_container));
|
||||
/* this is the blocking call we are going to lots of trouble
|
||||
to avoid them in the parent */
|
||||
status = ads_dns_lookup_srv(mem_ctx, NULL, name, &dclist, &count);
|
||||
status = ads_dns_lookup_srv(mem_ctx, name, &dclist, &count);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user