summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 91429c2415..94fd6cde1e 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -779,6 +779,15 @@ 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
+ * 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) {
+ 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;