winbind: handle MSG_SMB_CONF_UPDATED in the winbinds children
authorRalph Boehme <slow@samba.org>
Wed, 20 Jan 2021 11:00:16 +0000 (12:00 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Jan 2021 16:00:06 +0000 (16:00 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 072ef48001710ed8326c83295f2d3cc301d27cfe)

source3/winbindd/winbindd_dual.c

index 2885dd4d00578a6d767377988810c9c847864391..c13bf6e8b2fa6d1a027434c46c573464e0f4713e 100644 (file)
@@ -929,6 +929,16 @@ void winbind_disconnect_dc_parent(struct messaging_context *msg_ctx,
        forall_children(winbind_msg_relay_fn, &state);
 }
 
+static void winbindd_msg_reload_services_child(struct messaging_context *msg,
+                                              void *private_data,
+                                              uint32_t msg_type,
+                                              struct server_id server_id,
+                                              DATA_BLOB *data)
+{
+       DBG_DEBUG("Got reload-config message\n");
+       winbindd_reload_services_file((const char *)private_data);
+}
+
 /* React on 'smbcontrol winbindd reload-config' in the same way as on SIGHUP*/
 void winbindd_msg_reload_services_parent(struct messaging_context *msg,
                                         void *private_data,
@@ -936,12 +946,20 @@ void winbindd_msg_reload_services_parent(struct messaging_context *msg,
                                         struct server_id server_id,
                                         DATA_BLOB *data)
 {
+       struct winbind_msg_relay_state state = {
+               .msg_ctx = msg,
+               .msg_type = msg_type,
+               .data = data,
+       };
+
        DBG_DEBUG("Got reload-config message\n");
 
         /* Flush various caches */
        winbindd_flush_caches();
 
        winbindd_reload_services_file((const char *)private_data);
+
+       forall_children(winbind_msg_relay_fn, &state);
 }
 
 /* Set our domains as offline and forward the offline message to our children. */
@@ -1784,6 +1802,10 @@ static bool fork_domain_child(struct winbindd_child *child)
        messaging_register(global_messaging_context(), NULL,
                           MSG_WINBIND_DISCONNECT_DC,
                           winbind_msg_disconnect_dc);
+       messaging_register(global_messaging_context(),
+                          override_logfile ? NULL : child->logfilename,
+                          MSG_SMB_CONF_UPDATED,
+                          winbindd_msg_reload_services_child);
 
        primary_domain = find_our_domain();