s4-dsdb: use constant-time search for descriptor -> get_last_structural_class()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 26 Mar 2012 01:06:39 +0000 (12:06 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Mar 2012 03:38:13 +0000 (05:38 +0200)
The objectClass list is sorted at this point, as we are called below
the objectclass module here, or are working from a search result.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Mar 26 05:38:13 CEST 2012 on sn-devel-104

source4/dsdb/samdb/ldb_modules/descriptor.c
source4/dsdb/samdb/ldb_modules/samba_dsdb.c

index 47207db2014b0eb1095defc9cff275834f65d123..f2afe742af03c7e33baeec6ae5d36b954a77d91b 100644 (file)
@@ -543,7 +543,7 @@ static int descriptor_add(struct ldb_module *module, struct ldb_request *req)
        }
 
        objectclass = get_last_structural_class(schema, objectclass_element,
-                                               false);
+                                               true);
        if (objectclass == NULL) {
                return ldb_operr(ldb);
        }
@@ -662,7 +662,7 @@ static int descriptor_modify(struct ldb_module *module, struct ldb_request *req)
        }
 
        objectclass = get_last_structural_class(schema, objectclass_element,
-                                               false);
+                                               true);
        if (objectclass == NULL) {
                return ldb_operr(ldb);
        }
index c7c4fe377c057f473db9f4fd7356e726d074b104..d58b584b779673f10ed92690a24d0fea88d382f3 100644 (file)
@@ -150,6 +150,8 @@ static int samba_dsdb_init(struct ldb_module *module)
          - extended_dn_in must be before objectclass.c, as it resolves the DN
          - objectclass must be before password_hash and samldb since these LDB
            modules require the expanded "objectClass" list
+          - objectclass must be before descriptor, as descriptor assumes that 
+            objectClass values are sorted
          - objectclass_attrs must be behind operational in order to see all
            attributes (the operational module protects and therefore
            suppresses per default some important ones)