1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

winbind: handle MSG_SMB_CONF_UPDATED in the winbinds children

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>
This commit is contained in:
Ralph Boehme 2021-01-20 12:00:16 +01:00 committed by Jeremy Allison
parent 0c4497f8c6
commit 072ef48001

View File

@ -929,6 +929,16 @@ void winbind_disconnect_dc_parent(struct messaging_context *msg_ctx,
forall_children(winbind_msg_relay_fn, &state); 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*/ /* React on 'smbcontrol winbindd reload-config' in the same way as on SIGHUP*/
void winbindd_msg_reload_services_parent(struct messaging_context *msg, void winbindd_msg_reload_services_parent(struct messaging_context *msg,
void *private_data, void *private_data,
@ -936,12 +946,20 @@ void winbindd_msg_reload_services_parent(struct messaging_context *msg,
struct server_id server_id, struct server_id server_id,
DATA_BLOB *data) 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"); DBG_DEBUG("Got reload-config message\n");
/* Flush various caches */ /* Flush various caches */
winbindd_flush_caches(); winbindd_flush_caches();
winbindd_reload_services_file((const char *)private_data); 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. */ /* 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, messaging_register(global_messaging_context(), NULL,
MSG_WINBIND_DISCONNECT_DC, MSG_WINBIND_DISCONNECT_DC,
winbind_msg_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(); primary_domain = find_our_domain();