diff options
author | Andrew Bartlett <abartlet@samba.org> | 2015-07-28 16:11:54 +1200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2015-09-03 09:11:35 +0200 |
commit | 3c29480ab7ef9562779278a5064d18ea5c3d2f29 (patch) | |
tree | 62721995e830b5f25e85a7554a387d772ad4c86d | |
parent | df141f779f94acaea2c3876263d77fc8d8b6e3b7 (diff) | |
download | samba-3c29480ab7ef9562779278a5064d18ea5c3d2f29.tar.gz |
dbcheck: Add additional tests for the attributeID list
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2ff9b171378922e68205d5f0eefd2231607b5b89)
-rw-r--r-- | python/samba/dbchecker.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index a97b58a0e04..9da9cb01565 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -1237,6 +1237,20 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) if sorted(list_attid_from_md[:-1]) != list_attid_from_md[:-1]: error_count += 1 self.err_replmetadata_unsorted_attid(dn, attrname, obj[attrname]) + else: + # Here we check that the first attid is 0 + # (objectClass) and that the last on is the RDN + # from the DN. + rdn_attid = self.samdb_schema.get_attid_from_lDAPDisplayName(dn.get_rdn_name()) + if list_attid_from_md[-1] != rdn_attid: + error_count += 1 + self.report("ERROR: Not fixing incorrect final attributeID in '%s' on '%s', it should match the RDN %s" % + (attrname, str(dn), dn.get_rdn_name())) + + if list_attid_from_md[0] != 0: + error_count += 1 + self.report("ERROR: Not fixing incorrect inital attributeID in '%s' on '%s', it should be objectClass" % + (attrname, str(dn))) got_repl_property_meta_data = True continue |