From 66121dc89677b4b6e91f8b4cac893d709ab63544 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 20 Sep 2011 17:31:24 +1000 Subject: samba-tool: Enable comparison of DNS naming contexts in ldapcmp Signed-off-by: Andrew Tridgell --- source4/scripting/python/samba/netcmd/ldapcmp.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/ldapcmp.py b/source4/scripting/python/samba/netcmd/ldapcmp.py index 78e6fd356b..a6db4b11b0 100755 --- a/source4/scripting/python/samba/netcmd/ldapcmp.py +++ b/source4/scripting/python/samba/netcmd/ldapcmp.py @@ -73,6 +73,7 @@ class LDAPBase(object): self.verbose = verbose self.host = host self.base_dn = str(self.ldb.get_default_basedn()) + self.root_dn = str(self.ldb.get_root_basedn()) self.config_dn = str(self.ldb.get_config_basedn()) self.schema_dn = str(self.ldb.get_schema_basedn()) self.domain_netbios = self.find_netbios() @@ -685,7 +686,7 @@ class LDAPBundel(object): self.filter_list = filter_list if dn_list: self.dn_list = dn_list - elif context.upper() in ["DOMAIN", "CONFIGURATION", "SCHEMA"]: + elif context.upper() in ["DOMAIN", "CONFIGURATION", "SCHEMA", "DNSDOMAIN", "DNSFOREST"]: self.context = context.upper() self.dn_list = self.get_dn_list(context) else: @@ -809,6 +810,10 @@ class LDAPBundel(object): search_base = self.con.config_dn elif context.upper() == "SCHEMA": search_base = self.con.schema_dn + elif context.upper() == "DNSDOMAIN": + search_base = "DC=DomainDnsZones,%s" % self.con.base_dn + elif context.upper() == "DNSFOREST": + search_base = "DC=ForestDnsZones,%s" % self.con.root_dn dn_list = [] if not self.search_base: @@ -850,7 +855,7 @@ class LDAPBundel(object): class cmd_ldapcmp(Command): """compare two ldap databases""" - synopsis = "%prog (domain|configuration|schema) [options]" + synopsis = "%prog ldapcmp (domain|configuration|schema|dnsdomain|dnsforest) [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -920,7 +925,7 @@ class cmd_ldapcmp(Command): for c in [context1, context2, context3]: if c is None: continue - if not c.upper() in ["DOMAIN", "CONFIGURATION", "SCHEMA"]: + if not c.upper() in ["DOMAIN", "CONFIGURATION", "SCHEMA", "DNSDOMAIN", "DNSFOREST"]: raise CommandError("Incorrect argument: %s" % c) contexts.append(c.upper()) -- cgit