From 2ff9b171378922e68205d5f0eefd2231607b5b89 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 28 Jul 2015 16:11:54 +1200 Subject: [PATCH] dbcheck: Add additional tests for the attributeID list BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher --- python/samba/dbchecker.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.11.4.GIT