diff options
author | Simo Sorce <idra@samba.org> | 2012-05-04 17:27:36 -0400 |
---|---|---|
committer | Alexander Bokovoy <ab@samba.org> | 2012-05-23 17:51:48 +0300 |
commit | a7e94fce3f86b99c328669d45dd685fc70026378 (patch) | |
tree | 3e0f989c0c43a41d38eafa80e07805556d069793 /source3/libsmb | |
parent | 4a335e9632282d92c8d9c5fdae59114540ed0803 (diff) | |
download | samba-a7e94fce3f86b99c328669d45dd685fc70026378.tar.gz samba-a7e94fce3f86b99c328669d45dd685fc70026378.tar.bz2 samba-a7e94fce3f86b99c328669d45dd685fc70026378.zip |
s3-ads-dns: Break dependency on lp_parm
In preparation of making this code common to s3 and s4
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/dsgetdcname.c | 23 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 11 |
2 files changed, 23 insertions, 11 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 05be272450..a690ab49c1 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -546,24 +546,31 @@ 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; + dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL); if (flags & DS_PDC_REQUIRED) { - status = ads_dns_query_pdc(mem_ctx, domain_name, - &dcs, &numdcs); + status = ads_dns_query_pdc(mem_ctx, dns_hosts_file, + domain_name, &dcs, &numdcs); } else if (flags & DS_GC_SERVER_REQUIRED) { - status = ads_dns_query_gcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_gcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (flags & DS_KDC_REQUIRED) { - status = ads_dns_query_kdcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_kdcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (flags & DS_DIRECTORY_SERVICE_REQUIRED) { - status = ads_dns_query_dcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_dcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } else if (domain_guid) { - status = ads_dns_query_dcs_guid(mem_ctx, domain_name, - domain_guid, &dcs, &numdcs); + status = ads_dns_query_dcs_guid(mem_ctx, dns_hosts_file, + domain_name, domain_guid, + &dcs, &numdcs); } else { - status = ads_dns_query_dcs(mem_ctx, domain_name, site_name, + status = ads_dns_query_dcs(mem_ctx, dns_hosts_file, + domain_name, site_name, &dcs, &numdcs); } diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 8934d85243..417464c17e 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2424,6 +2424,7 @@ 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,23 +2438,27 @@ 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, name, &dcs, &numdcs); + status = ads_dns_query_pdc(ctx, dns_hosts_file, + 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, name, sitename, &dcs, + status = ads_dns_query_dcs(ctx, dns_hosts_file, + 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, name, sitename, &dcs, + status = ads_dns_query_kdcs(ctx, dns_hosts_file, + name, sitename, &dcs, &numdcs); break; default: |