From 2ad701911e2bd5d4cdc5d5db64449f3cc01df3cd Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Fri, 16 Jul 2010 14:01:49 +0300 Subject: s4-dsdb: use ldb_msg_normalize() in source4/lib/ldb/common/ldb.c Signed-off-by: Andrew Bartlett --- source4/lib/ldb/common/ldb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source4') 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; -- cgit