summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-rw-r--r--source3/nsswitch/winbindd.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index ef55fe5123..0336312e89 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -66,6 +66,7 @@ static BOOL reload_services_file(BOOL test)
return(ret);
}
+
#if DUMP_CORE
/**************************************************************************** **
@@ -201,6 +202,20 @@ static void sighup_handler(int signum)
sys_select_signal();
}
+/* React on 'smbcontrol winbindd reload-config' in the same way as on SIGHUP*/
+static void msg_reload_services(int msg_type, pid_t src, void *buf, size_t len)
+{
+ /* Flush various caches */
+ flush_caches();
+ reload_services_file(True);
+}
+
+/* React on 'smbcontrol winbindd shutdown' in the same way as on SIGTERM*/
+static void msg_shutdown(int msg_type, pid_t src, void *buf, size_t len)
+{
+ terminate();
+}
+
struct dispatch_table {
enum winbindd_cmd cmd;
enum winbindd_result (*fn)(struct winbindd_cli_state *state);
@@ -746,11 +761,8 @@ static void process_loop(void)
if (do_sighup) {
DEBUG(3, ("got SIGHUP\n"));
-
- /* Flush various caches */
- flush_caches();
- reload_services_file(True);
+ msg_reload_services(MSG_SMB_CONF_UPDATED, (pid_t) 0, NULL, 0);
do_sighup = False;
}
@@ -919,6 +931,12 @@ int main(int argc, char **argv)
DEBUG(0, ("unable to initialise messaging system\n"));
exit(1);
}
+
+ /* 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);
+
poptFreeContext(pc);
netsamlogon_cache_init(); /* Non-critical */