diff options
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r-- | source4/lib/ldb/modules/operational.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c index 070f91e762..d796e93e54 100644 --- a/source4/lib/ldb/modules/operational.c +++ b/source4/lib/ldb/modules/operational.c @@ -522,8 +522,10 @@ static int operational_add_async(struct ldb_module *module, struct ldb_request * return LDB_ERR_OPERATIONS_ERROR; } + *down_req = *req; + /* we have to copy the message as the caller might have it as a const */ - msg = ldb_msg_copy_shallow(down_req, req->op.add.message); + down_req->op.mod.message = msg = ldb_msg_copy_shallow(down_req, req->op.mod.message); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } @@ -543,15 +545,6 @@ static int operational_add_async(struct ldb_module *module, struct ldb_request * } } - down_req->op.add.message = msg; - - down_req->controls = req->controls; - down_req->creds = req->creds; - - down_req->async.context = req->async.context; - down_req->async.callback = req->async.callback; - down_req->async.timeout = req->async.timeout; - /* go on with the call chain */ ret = ldb_next_request(module, down_req); @@ -583,8 +576,10 @@ static int operational_modify_async(struct ldb_module *module, struct ldb_reques return LDB_ERR_OPERATIONS_ERROR; } + *down_req = *req; + /* we have to copy the message as the caller might have it as a const */ - msg = ldb_msg_copy_shallow(down_req, req->op.mod.message); + down_req->op.mod.message = msg = ldb_msg_copy_shallow(down_req, req->op.mod.message); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } @@ -600,16 +595,7 @@ static int operational_modify_async(struct ldb_module *module, struct ldb_reques talloc_free(down_req); return -1; } - - down_req->op.mod.message = msg; - down_req->controls = req->controls; - down_req->creds = req->creds; - - down_req->async.context = req->async.context; - down_req->async.callback = req->async.callback; - down_req->async.timeout = req->async.timeout; - /* go on with the call chain */ ret = ldb_next_request(module, down_req); |