diff options
author | Volker Lendecke <vl@samba.org> | 2018-02-26 13:24:50 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-03-01 09:53:45 +0100 |
commit | dba9a12e304d305a91c336681a34637bc41ac90b (patch) | |
tree | 0b9e98a5630a1fe74d1e05f7b346a82e6515eefb /source3 | |
parent | 0c58fb365a9652544b0fd40b52a79e641933a528 (diff) | |
download | samba-dba9a12e304d305a91c336681a34637bc41ac90b.tar.gz |
winbind: Use forall_domain_children in winbind_msg_online
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13309
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/winbindd_dual.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index adca4185ac1..c4047326a49 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -941,7 +941,10 @@ void winbind_msg_online(struct messaging_context *msg_ctx, struct server_id server_id, DATA_BLOB *data) { - struct winbindd_child *child; + struct winbind_msg_on_offline_state state = { + .msg_ctx = msg_ctx, + .msg_type = MSG_WINBIND_ONLINE, + }; struct winbindd_domain *domain; DEBUG(10,("winbind_msg_online: got online message.\n")); @@ -983,28 +986,7 @@ void winbind_msg_online(struct messaging_context *msg_ctx, } } - for (child = winbindd_children; child != NULL; child = child->next) { - /* Only set domain children online */ - if (child->domain == NULL) { - continue; - } - - /* Or internal domains (this should not be possible....) */ - if (child->domain->internal) { - continue; - } - - /* Each winbindd child should only process requests for one domain - make sure - we only set it online / offline for that domain. */ - - DEBUG(10,("winbind_msg_online: sending message to pid %u for domain %s.\n", - (unsigned int)child->pid, child->domain->name )); - - messaging_send_buf(msg_ctx, pid_to_procid(child->pid), - MSG_WINBIND_ONLINE, - (const uint8_t *)child->domain->name, - strlen(child->domain->name)+1); - } + forall_domain_children(winbind_msg_on_offline_fn, &state); } static const char *collect_onlinestatus(TALLOC_CTX *mem_ctx) |