diff options
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd.c | 32 | ||||
-rw-r--r-- | source3/winbindd/winbindd_proto.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index a1647c947f..8a2c09e515 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) { diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 65553f70ed..642aadd440 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -27,6 +27,7 @@ /* The following definitions come from winbindd/winbindd.c */ struct messaging_context *winbind_messaging_context(void); +struct imessaging_context *winbind_imessaging_context(void); void request_error(struct winbindd_cli_state *state); void request_ok(struct winbindd_cli_state *state); bool winbindd_setup_sig_term_handler(bool parent); |