summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/schema.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-09-25 22:53:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:19 -0500
commit7a1c1a1fd88d907c3ed4b336ac50ba06896593b4 (patch)
tree7e0ef99879fdd7fbf58330e3dc1facb6ed8492ca /source4/dsdb/samdb/ldb_modules/schema.c
parent95340f8afb12b8c9bcaaa230b4cad74e77a79a9c (diff)
downloadsamba-7a1c1a1fd88d907c3ed4b336ac50ba06896593b4.tar.gz
samba-7a1c1a1fd88d907c3ed4b336ac50ba06896593b4.tar.bz2
samba-7a1c1a1fd88d907c3ed4b336ac50ba06896593b4.zip
r18908: Store the schema structure into an opaque pointer so that it can be reused by multiple connections
(This used to be commit ca8827d8f9a9f6ec60afed29b0b85f491d725d1c)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/schema.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema.c b/source4/dsdb/samdb/ldb_modules/schema.c
index 95330e7e8c..1a7060a524 100644
--- a/source4/dsdb/samdb/ldb_modules/schema.c
+++ b/source4/dsdb/samdb/ldb_modules/schema.c
@@ -496,8 +496,8 @@ static int schema_init_classes(struct ldb_module *module, struct schema_private_
data->class[i]->defobjcat = talloc_strdup(data->class[i],
ldb_msg_find_attr_as_string(res->msgs[i],
"defaultObjectCategory", NULL));
- SCHEMA_CHECK_VALUE(data->class[i]->defobjcat, NULL, module);
-
+/* SCHEMA_CHECK_VALUE(data->class[i]->defobjcat, NULL, module);
+*/
/* the following attributes are all optional */
data->class[i]->systemOnly = ldb_msg_find_attr_as_bool(res->msgs[i], "systemOnly", False);
@@ -1028,9 +1028,9 @@ static int schema_add_build_down_req(struct schema_context *sctx)
if (!temp->next) break;
if (temp->next->role != SCHEMA_CT_STRUCTURAL) break;
}
- oc = talloc_strdup(msg, temp->class->defobjcat);
+/* oc = talloc_strdup(msg, temp->class->defobjcat);
ret = ldb_msg_add_string(msg, "objectCategory", oc);
-
+*/
sctx->down_req->op.add.message = msg;
return LDB_SUCCESS;
@@ -1250,13 +1250,19 @@ static int schema_init(struct ldb_module *module)
struct ldb_result *res;
int ret;
- /* need to let the partiorion module to register first */
+ /* need to let the partition module to register first */
ret = ldb_next_init(module);
if (ret != LDB_SUCCESS) {
return ret;
}
- data = talloc_zero(module, struct schema_private_data);
+ data = ldb_get_opaque(module->ldb, "schema_instance");
+ if (data) {
+ module->private_data = data;
+ return LDB_SUCCESS;
+ }
+
+ data = talloc_zero(module->ldb, struct schema_private_data);
if (data == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -1299,6 +1305,8 @@ static int schema_init(struct ldb_module *module)
}
module->private_data = data;
+ ldb_set_opaque(module->ldb, "schema_instance", data);
+
return LDB_SUCCESS;
}