diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-09-20 17:31:24 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-11-02 15:26:54 +1100 |
commit | 66121dc89677b4b6e91f8b4cac893d709ab63544 (patch) | |
tree | 29aa198d37dd9cc8f42fb203d092035fe7ed3860 /source4/scripting | |
parent | cde73e2ecec75f0b068555203962b43a4438d349 (diff) | |
download | samba-66121dc89677b4b6e91f8b4cac893d709ab63544.tar.gz samba-66121dc89677b4b6e91f8b4cac893d709ab63544.tar.bz2 samba-66121dc89677b4b6e91f8b4cac893d709ab63544.zip |
samba-tool: Enable comparison of DNS naming contexts in ldapcmp
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-x | source4/scripting/python/samba/netcmd/ldapcmp.py | 11 |
1 files 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 <URL1> <URL2> (domain|configuration|schema) [options]" + synopsis = "%prog ldapcmp <URL1> <URL2> (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()) |