diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-06-09 16:05:31 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-06-10 21:48:20 +0200 |
commit | 970fdfae6a18bf11d423a72973c0f7b589e6f92a (patch) | |
tree | b61e542a464306866c7228e3af44864c4c886f63 /python | |
parent | f5e945c810b5e453b699d4e796cfb6790c442a17 (diff) | |
download | samba-970fdfae6a18bf11d423a72973c0f7b589e6f92a.tar.gz |
pydsdb_dns: Allow the partition DN to be specified into py_dsdb_dns_lookup
This allows lookups to be confined to one partition, which in turn avoids issues
when running this against MS Windows, which does not match Samba behaviour
for dns_common_zones()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/samdb.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 719bb8b2d90..638fa06ec8a 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -930,9 +930,13 @@ accountExpires: %u res = self.search(base="", scope=ldb.SCOPE_BASE, attrs=["serverName"]) return res[0]["serverName"][0] - def dns_lookup(self, dns_name): + def dns_lookup(self, dns_name, dns_partition=None): '''Do a DNS lookup in the database, returns the NDR database structures''' - return dsdb_dns.lookup(self, dns_name) + if dns_partition is None: + return dsdb_dns.lookup(self, dns_name) + else: + return dsdb_dns.lookup(self, dns_name, + dns_partition=dns_partition) def dns_extract(self, el): '''Return the NDR database structures from a dnsRecord element''' |