summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-26 12:08:22 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-04-27 11:40:18 +1000
commite130dec97bb4e08b11f39c1c1382f0c8ad36ef67 (patch)
tree23a24bce465618eb7dc6a6f52c9b92e02e582540 /source3/libads
parent806eef63ba6ee9681f89accea262a0c2fa3c8038 (diff)
downloadsamba-e130dec97bb4e08b11f39c1c1382f0c8ad36ef67.tar.gz
samba-e130dec97bb4e08b11f39c1c1382f0c8ad36ef67.tar.bz2
samba-e130dec97bb4e08b11f39c1c1382f0c8ad36ef67.zip
s3-libsmb Use 'resolv:hosts file' as a DNS emulation when specified.
This allows make test to operate without making real DNS calls. Andrew Bartlett
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/dns.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c
index 113e63710b..152003941b 100644
--- a/source3/libads/dns.c
+++ b/source3/libads/dns.c
@@ -401,11 +401,19 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
int rrnum;
int idx = 0;
NTSTATUS status;
+ const char *dns_hosts_file;
if ( !ctx || !name || !dclist ) {
return NT_STATUS_INVALID_PARAMETER;
}
+ dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
+ 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 */
@@ -590,11 +598,18 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
int rrnum;
int idx = 0;
NTSTATUS status;
+ const char *dns_hosts_file;
if ( !ctx || !dnsdomain || !nslist ) {
return NT_STATUS_INVALID_PARAMETER;
}
+ dns_hosts_file = lp_parm_const_string(-1, "resolv", "host file", NULL);
+ 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 */