summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-14 18:19:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:52 -0500
commit47523dbc6a03498b362f08897c260f7cdebe271b (patch)
tree4cd082df4bba20d7908ea3eca702469ce34010ab /source4/dsdb/samdb/ldb_modules
parent0de68094bf80bb475d0901792f3e609565865850 (diff)
downloadsamba-47523dbc6a03498b362f08897c260f7cdebe271b.tar.gz
samba-47523dbc6a03498b362f08897c260f7cdebe271b.tar.bz2
samba-47523dbc6a03498b362f08897c260f7cdebe271b.zip
r20776: require a loaded dsdb_schema for originating add and modify operations
(later we'll require it for all originating changes...) metze (This used to be commit fc1a836eccc0913fdab644341fa3e37a2f086de8)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index d88ca5f05e..c91fcb2f40 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -168,7 +168,9 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
return 0;
}
-static int replmd_add_originating(struct ldb_module *module, struct ldb_request *req)
+static int replmd_add_originating(struct ldb_module *module,
+ struct ldb_request *req,
+ const struct dsdb_schema *schema)
{
struct ldb_request *down_req;
struct ldb_message_element *attribute;
@@ -248,15 +250,25 @@ static int replmd_add_originating(struct ldb_module *module, struct ldb_request
static int replmd_add(struct ldb_module *module, struct ldb_request *req)
{
+ const struct dsdb_schema *schema;
+
/* do not manipulate our control entries */
if (ldb_dn_is_special(req->op.add.message->dn)) {
return ldb_next_request(module, req);
}
- return replmd_add_originating(module, req);
+ schema = dsdb_get_schema(module->ldb);
+ if (!schema) {
+ ldb_debug_set(module->ldb, LDB_DEBUG_FATAL, "replmd_add: no dsdb_schema loaded");
+ return LDB_ERR_CONSTRAINT_VIOLATION;
+ }
+
+ return replmd_add_originating(module, req, schema);
}
-static int replmd_modify_originating(struct ldb_module *module, struct ldb_request *req)
+static int replmd_modify_originating(struct ldb_module *module,
+ struct ldb_request *req,
+ const struct dsdb_schema *schema)
{
struct ldb_request *down_req;
struct ldb_message *msg;
@@ -310,12 +322,20 @@ static int replmd_modify_originating(struct ldb_module *module, struct ldb_reque
static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
{
+ const struct dsdb_schema *schema;
+
/* do not manipulate our control entries */
if (ldb_dn_is_special(req->op.mod.message->dn)) {
return ldb_next_request(module, req);
}
- return replmd_modify_originating(module, req);
+ schema = dsdb_get_schema(module->ldb);
+ if (!schema) {
+ ldb_debug_set(module->ldb, LDB_DEBUG_FATAL, "replmd_modify: no dsdb_schema loaded");
+ return LDB_ERR_CONSTRAINT_VIOLATION;
+ }
+
+ return replmd_modify_originating(module, req, schema);
}
static int replmd_replicated_request_reply_helper(struct replmd_replicated_request *ar, int ret)
@@ -553,8 +573,8 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
* TODO: add rename conflict handling
*/
if (ldb_dn_compare(msg->dn, ar->sub.search_msg->dn) != 0) {
- ldb_debug(ar->module->ldb, LDB_DEBUG_FATAL, "replmd_replicated_apply_merge[%u]: rename not supported",
- ar->index_current);
+ ldb_debug_set(ar->module->ldb, LDB_DEBUG_FATAL, "replmd_replicated_apply_merge[%u]: rename not supported",
+ ar->index_current);
ldb_debug(ar->module->ldb, LDB_DEBUG_FATAL, "%s => %s\n",
ldb_dn_get_linearized(ar->sub.search_msg->dn),
ldb_dn_get_linearized(msg->dn));