diff options
Diffstat (limited to 'source/nsswitch/winbindd.c')
-rw-r--r-- | source/nsswitch/winbindd.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index 1df1a1d27b8..341fa00c923 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -34,6 +34,16 @@ static BOOL interactive = False; extern BOOL override_logfile; +struct event_context *winbind_event_context(void) +{ + static struct event_context *ctx; + + if (!ctx && !(ctx = event_context_init(NULL))) { + smb_panic("Could not init winbind event context\n"); + } + return ctx; +} + /* Reload configuration */ static BOOL reload_services_file(void) @@ -164,7 +174,8 @@ static void sigchld_handler(int signum) } /* React on 'smbcontrol winbindd reload-config' in the same way as on SIGHUP*/ -static void msg_reload_services(int msg_type, struct process_id src, void *buf, size_t len) +static void msg_reload_services(int msg_type, struct process_id src, + void *buf, size_t len, void *private_data) { /* Flush various caches */ flush_caches(); @@ -172,7 +183,8 @@ static void msg_reload_services(int msg_type, struct process_id src, void *buf, } /* React on 'smbcontrol winbindd shutdown' in the same way as on SIGTERM*/ -static void msg_shutdown(int msg_type, struct process_id src, void *buf, size_t len) +static void msg_shutdown(int msg_type, struct process_id src, + void *buf, size_t len, void *private_data) { do_sigterm = True; } @@ -718,7 +730,7 @@ static void process_loop(void) message_dispatch(); - run_events(); + run_events(winbind_event_context(), 0, NULL, NULL); /* refresh the trusted domain cache */ @@ -750,7 +762,7 @@ static void process_loop(void) timeout.tv_usec = 0; /* Check for any event timeouts. */ - if (get_timed_events_timeout(&ev_timeout)) { + if (get_timed_events_timeout(winbind_event_context(), &ev_timeout)) { timeout = timeval_min(&timeout, &ev_timeout); } @@ -869,7 +881,7 @@ static void process_loop(void) DEBUG(3, ("got SIGHUP\n")); - msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0); + msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); do_sighup = False; } @@ -1053,13 +1065,14 @@ int main(int argc, char **argv, char **envp) /* React on 'smbcontrol winbindd reload-config' in the same way as to SIGHUP signal */ - message_register(MSG_SMB_CONF_UPDATED, msg_reload_services); - message_register(MSG_SHUTDOWN, msg_shutdown); + message_register(MSG_SMB_CONF_UPDATED, msg_reload_services, NULL); + message_register(MSG_SHUTDOWN, msg_shutdown, NULL); /* Handle online/offline messages. */ - message_register(MSG_WINBIND_OFFLINE,winbind_msg_offline); - message_register(MSG_WINBIND_ONLINE,winbind_msg_online); - message_register(MSG_WINBIND_ONLINESTATUS,winbind_msg_onlinestatus); + message_register(MSG_WINBIND_OFFLINE, winbind_msg_offline, NULL); + message_register(MSG_WINBIND_ONLINE, winbind_msg_online, NULL); + message_register(MSG_WINBIND_ONLINESTATUS, winbind_msg_onlinestatus, + NULL); poptFreeContext(pc); |