summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 877f283491..3a0ca464a4 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -795,15 +795,17 @@ int ldb_request(struct ldb_context *ldb, struct ldb_request *req)
ret = module->ops->search(module, req);
break;
case LDB_ADD:
- /* we have to canonicalise here, as so many places
+ /*
+ * we have to normalize here, as so many places
* in modules and backends assume we don't have two
- * elements with the same name */
- req->op.add.message = ldb_msg_canonicalize(ldb, req->op.add.message);
- if (!req->op.add.message) {
+ * elements with the same name
+ */
+ ret = ldb_msg_normalize(ldb, req, req->op.add.message,
+ discard_const(&req->op.add.message));
+ if (ret != LDB_SUCCESS) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
- talloc_steal(req, req->op.add.message);
FIRST_OP(ldb, add);
ret = module->ops->add(module, req);
break;