From: Ralph Boehme Date: Sat, 9 Jul 2016 12:33:52 +0000 (+0200) Subject: s3-messaging: use messaging_ctdbd_reinit() in messaging_reinit() X-Git-Tag: tdb-1.3.10~425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a391e9202db6a8f64f2fe12d0ab5752f6e684f84;p=thirdparty%2Fsamba.git s3-messaging: use messaging_ctdbd_reinit() in messaging_reinit() This is the last step to fix a regression introduced by 3fe3226daa8488e0fa787c40359c3401b6f05fc0 and 3fe3226daa8488e0fa787c40359c3401b6f05fc0^ where we pass the ctdb-messaging object conn to db_open() and add a reference to it to the private db_ctdb_ctx for later use. Unfortunately reinit_after_fork() destroys conn, leaving us with an invalid reference. The previous patches added new lower level functions messaging_ctdbd_reinit() and ctdbd_reinit_connection(), finally use them them from messaging_reinit(). They preserve the conn object and simply reinitialize the IPC fd. Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Jul 11 23:45:20 CEST 2016 on sn-devel-144 --- diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 65e975ec788..5d90947678e 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -416,11 +416,9 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) return map_nt_error_from_unix(ret); } - TALLOC_FREE(msg_ctx->remote); - if (lp_clustering()) { - ret = messaging_ctdbd_init(msg_ctx, msg_ctx, - &msg_ctx->remote); + ret = messaging_ctdbd_reinit(msg_ctx, msg_ctx, + msg_ctx->remote); if (ret != 0) { DEBUG(1, ("messaging_ctdbd_init failed: %s\n",