summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/winbindd.c')
-rw-r--r--source3/winbindd/winbindd.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index a1647c947fa..8a2c09e5158 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -39,6 +39,9 @@
#include "messages.h"
#include "../lib/util/pidfile.h"
#include "util_cluster.h"
+#include "source4/lib/messaging/irpc.h"
+#include "source4/lib/messaging/messaging.h"
+#include "lib/param/param.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
@@ -89,6 +92,33 @@ struct messaging_context *winbind_messaging_context(void)
return msg;
}
+struct imessaging_context *winbind_imessaging_context(void)
+{
+ static struct imessaging_context *msg = NULL;
+ struct loadparm_context *lp_ctx;
+
+ if (msg != NULL) {
+ return msg;
+ }
+
+ lp_ctx = loadparm_init_s3(NULL, loadparm_s3_helpers());
+ if (lp_ctx == NULL) {
+ smb_panic("Could not load smb.conf to init winbindd's imessaging context.\n");
+ }
+
+ /*
+ * Note we MUST use the NULL context here, not the autofree context,
+ * to avoid side effects in forked children exiting.
+ */
+ msg = imessaging_init(NULL, lp_ctx, procid_self(), winbind_event_context(), false);
+ talloc_unlink(NULL, lp_ctx);
+
+ if (msg == NULL) {
+ smb_panic("Could not init winbindd's messaging context.\n");
+ }
+ return msg;
+}
+
/* Reload configuration */
static bool reload_services_file(const char *lfile)
@@ -1588,6 +1618,8 @@ int main(int argc, const char **argv)
exit_daemon("Winbindd failed to setup listeners", EPIPE);
}
+ irpc_add_name(winbind_imessaging_context(), "winbind_server");
+
TALLOC_FREE(frame);
if (!interactive) {