I can just assume this is a bad hack for a condition that should have been
fixed in a different way. Today we pretty much expect a messaging_context to be
properly initialized everywhere, and this includes a ctdb connection.
If something later fails due to this commit, we need to do a
messaging_init before the offending call
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
struct ctdb_req_control req;
struct ctdb_req_header *hdr;
struct ctdb_reply_control *reply = NULL;
- struct ctdbd_connection *new_conn = NULL;
struct iovec iov[2];
ssize_t nwritten;
NTSTATUS status;
int ret;
- if (conn == NULL) {
- status = ctdbd_init_connection(NULL, &new_conn);
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("Could not init temp connection: %s\n",
- nt_errstr(status)));
- goto fail;
- }
-
- conn = new_conn;
- }
-
ZERO_STRUCT(req);
req.hdr.length = offsetof(struct ctdb_req_control, data) + data.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
}
if (flags & CTDB_CTRL_FLAG_NOREPLY) {
- TALLOC_FREE(new_conn);
if (cstatus) {
*cstatus = 0;
}
status = NT_STATUS_OK;
fail:
- TALLOC_FREE(new_conn);
TALLOC_FREE(reply);
return status;
}