From ec6839ac26ee54c501e3377d446cf9884175034e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Jun 2010 15:50:13 +1000 Subject: [PATCH] s4:dsdb use dsdb_module_modify() rather than ldb_next_request() This does exactly the same thing, but with less code. Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/linked_attributes.c | 24 ++-------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c index 2da5a825830..82fe27ef7f9 100644 --- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c +++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c @@ -907,7 +907,6 @@ static int la_find_dn_target(struct ldb_module *module, struct la_context *ac, static int la_do_op_request(struct ldb_module *module, struct la_context *ac, struct la_op_store *op) { struct ldb_message_element *ret_el; - struct ldb_request *mod_req; struct ldb_message *new_msg; struct ldb_context *ldb; int ret; @@ -955,33 +954,14 @@ static int la_do_op_request(struct ldb_module *module, struct la_context *ac, st ret_el->values[0].data, ac->ops->op == LA_OP_ADD ? "added" : "deleted"); #endif - ret = ldb_build_mod_req(&mod_req, ldb, op, - new_msg, - NULL, - NULL, - ldb_op_default_callback, - NULL); - if (ret != LDB_SUCCESS) { - return ret; - } - talloc_steal(mod_req, new_msg); - if (DEBUGLVL(4)) { DEBUG(4,("Applying linked attribute change:\n%s\n", ldb_ldif_message_string(ldb, op, LDB_CHANGETYPE_MODIFY, new_msg))); } - /* Run the new request */ - ret = ldb_next_request(module, mod_req); - - /* we need to wait for this to finish, as we are being called - from the synchronous end_transaction hook of this module */ - if (ret == LDB_SUCCESS) { - ret = ldb_wait(mod_req->handle, LDB_WAIT_ALL); - } - + ret = dsdb_module_modify(module, new_msg, 0); if (ret != LDB_SUCCESS) { - ldb_debug(ldb, LDB_DEBUG_WARNING, "Failed to apply linked attribute change '%s' %s\n", + ldb_debug(ldb, LDB_DEBUG_WARNING, "Failed to apply linked attribute change '%s'\n%s\n", ldb_errstring(ldb), ldb_ldif_message_string(ldb, op, LDB_CHANGETYPE_MODIFY, new_msg)); } -- 2.11.4.GIT