From: Ralph Boehme Date: Sat, 4 May 2019 10:12:04 +0000 (+0200) Subject: s3:dbwrap: initialize messaging before getting the ctdb connection X-Git-Tag: talloc-2.3.1~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca95d7f41b683b4d7ac59ed6ee709d44abfe2019;p=thirdparty%2Fsamba.git s3:dbwrap: initialize messaging before getting the ctdb connection This is a better fix for bug #13465. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index c8dfd9103a8..20084bca471 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -141,13 +141,19 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx; struct ctdbd_connection *conn; + /* + * Initialize messaging before getting the ctdb + * connection, as the ctdb connection requires messaging + * to be initialized. + */ + msg_ctx = global_messaging_context(); + conn = messaging_ctdb_connection(); if (conn == NULL) { DBG_WARNING("No ctdb connection\n"); errno = EIO; return NULL; } - msg_ctx = global_messaging_context(); result = db_open_ctdb(mem_ctx, msg_ctx, base, hash_size,