s4-dsdb: use ldb_msg_normalize() in source4/lib/ldb/common/ldb.c
authorKamen Mazdrashki <kamenim@samba.org>
Fri, 16 Jul 2010 11:01:49 +0000 (14:01 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Fri, 16 Jul 2010 11:29:14 +0000 (14:29 +0300)
source4/lib/ldb/common/ldb.c

index 877f283491f265ee7ea16f91c1f5b11855524d7f..3a0ca464a475cc5c0c77af4bc7596b4906fef1e7 100644 (file)
@@ -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;