diff options
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/entryUUID.c | 6 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/entryUUID.c b/source4/dsdb/samdb/ldb_modules/entryUUID.c index 826a895dbc..06e5384cff 100644 --- a/source4/dsdb/samdb/ldb_modules/entryUUID.c +++ b/source4/dsdb/samdb/ldb_modules/entryUUID.c @@ -116,7 +116,7 @@ static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC entryUUID_private = talloc_get_type(map_private->caller_private, struct entryUUID_private); list = entryUUID_private->objectclass_res; - for (i=0; list && i < list->count; i++) { + for (i=0; list && (i < list->count); i++) { if (ldb_attr_cmp(val->data, ldb_msg_find_attr_as_string(list->msgs[i], "lDAPDisplayName", NULL)) == 0) { char *dn = ldb_dn_linearize(ctx, list->msgs[i]->dn); return data_blob_string_const(dn); @@ -137,7 +137,7 @@ static struct ldb_val class_to_oid(struct ldb_module *module, TALLOC_CTX *ctx, c entryUUID_private = talloc_get_type(map_private->caller_private, struct entryUUID_private); list = entryUUID_private->objectclass_res; - for (i=0; list && i < list->count; i++) { + for (i=0; list && (i < list->count); i++) { if (ldb_attr_cmp(val->data, ldb_msg_find_attr_as_string(list->msgs[i], "lDAPDisplayName", NULL)) == 0) { const char *oid = ldb_msg_find_attr_as_string(list->msgs[i], "governsID", NULL); return data_blob_string_const(oid); @@ -158,7 +158,7 @@ static struct ldb_val class_from_oid(struct ldb_module *module, TALLOC_CTX *ctx, entryUUID_private = talloc_get_type(map_private->caller_private, struct entryUUID_private); list = entryUUID_private->objectclass_res; - for (i=0; list && i < list->count; i++) { + for (i=0; list && (i < list->count); i++) { if (ldb_attr_cmp(val->data, ldb_msg_find_attr_as_string(list->msgs[i], "governsID", NULL)) == 0) { const char *oc = ldb_msg_find_attr_as_string(list->msgs[i], "lDAPDisplayName", NULL); return data_blob_string_const(oc); diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index ba0c2bc9f4..889c0bfeb0 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -643,6 +643,10 @@ static int partition_init(struct ldb_module *module) data->replicate[i] = NULL; } + /* Make the private data available to any searches the modules may trigger in initialisation */ + module->private_data = data; + talloc_steal(module, data); + modules_attributes = ldb_msg_find_element(msg, "modules"); if (modules_attributes) { for (i=0; i < modules_attributes->num_values; i++) { @@ -708,9 +712,6 @@ static int partition_init(struct ldb_module *module) } } - module->private_data = data; - talloc_steal(module, data); - talloc_free(mem_ctx); return ldb_next_init(module); } |