struct fsmo_transfer_state {
struct ldb_context *ldb;
struct ldb_request *req;
+ struct ldb_module *module;
};
/*
struct fsmo_transfer_state *fsmo = tevent_req_callback_data(treq, struct fsmo_transfer_state);
NTSTATUS status;
WERROR werr;
+ int ret;
struct ldb_request *req = fsmo->req;
struct ldb_context *ldb = fsmo->ldb;
talloc_free(fsmo);
if (!NT_STATUS_IS_OK(status)) {
ldb_asprintf_errstring(ldb, "Failed FSMO transfer: %s", nt_errstr(status));
+ /*
+ * Now that it is failed, start the transaction up
+ * again so the wrappers can close it without additional error
+ */
+ ldb_next_start_trans(fsmo->module);
ldb_module_done(req, NULL, NULL, LDB_ERR_UNAVAILABLE);
return;
}
if (!W_ERROR_IS_OK(werr)) {
ldb_asprintf_errstring(ldb, "Failed FSMO transfer: %s", win_errstr(werr));
+ /*
+ * Now that it is failed, start the transaction up
+ * again so the wrappers can close it without additional error
+ */
+ ldb_next_start_trans(fsmo->module);
ldb_module_done(req, NULL, NULL, LDB_ERR_UNAVAILABLE);
return;
}
- ldb_module_done(req, NULL, NULL, LDB_SUCCESS);
+ /*
+ * Now that it is done, start the transaction up again so the
+ * wrappers can close it without error
+ */
+ ret = ldb_next_start_trans(fsmo->module);
+ ldb_module_done(req, NULL, NULL, ret);
}
static int rootdse_become_master(struct ldb_module *module,
"RODC cannot become a role master.");
}
+ /*
+ * We always delete the transaction, not commit it, because
+ * this gives the least supprise to this supprising action (as
+ * we will never record anything done to this point
+ */
+ ldb_next_del_trans(module);
+
msg = imessaging_client_init(tmp_ctx, lp_ctx,
ldb_get_event_context(ldb));
if (!msg) {
}
fsmo->ldb = ldb;
fsmo->req = req;
+ fsmo->module = module;
/*
* we send the call asynchronously, as the ldap client is