summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-22 10:05:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:28 -0500
commit6ddd5f6e6686644be8163f289c9480253b45db12 (patch)
tree1b67908f39ffc21e205beb80abd00db08a3a5572 /source4/dsdb/samdb/ldb_modules
parentd5c4606798fe291593f7d70080c25643a48124c0 (diff)
downloadsamba-6ddd5f6e6686644be8163f289c9480253b45db12.tar.gz
samba-6ddd5f6e6686644be8163f289c9480253b45db12.tar.bz2
samba-6ddd5f6e6686644be8163f289c9480253b45db12.zip
r17703: Fixes to enable the entryUUID module to work for it's objectClass ->
OID mappings. The key point is to 'enable' the partitions in the partitions module before the init is complete. That way, the modules can perform searches that use partitions. Andrew Bartlett (This used to be commit 420d1920a6824a6c0cb70b4ba832ddb90b0e95ff)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/entryUUID.c6
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c7
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);
}