The branch, master has been updated via 3fbc514a2c3 docs:smbdotconf: Inform that changing 'winbind max domain connections' needs a restart via 8abac09763a s3:winbindd: Use a correct value for the length of domain children via b13d4370d2b s3:winbindd: Avoid doing the same assignment twice from 3afa27a01ca mdssvc: better support for search with mdfind from Macs
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 3fbc514a2c350daa358a3a172df63b6ca9056c2e Author: Pavel Filipenský <pfilipen...@samba.org> Date: Mon Aug 28 09:44:39 2023 +0200 docs:smbdotconf: Inform that changing 'winbind max domain connections' needs a restart Signed-off-by: Pavel Filipenský <pfilipen...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipen...@samba.org> Autobuild-Date(master): Wed Aug 30 13:37:37 UTC 2023 on atb-devel-224 commit 8abac09763aa06ad7137b9de35d18b5528e4033b Author: Pavel Filipenský <pfilipen...@samba.org> Date: Fri Aug 25 09:50:56 2023 +0200 s3:winbindd: Use a correct value for the length of domain children We often loop over the array of domain children. However, the size of the array is calculated as lp_winbind_max_domain_connections() which can change (it is based on smb.conf). The fix is the talloc_array_length(). Reproducer: winbind max domain connections = 100 smbcontrol all reload-config smbcontrol all debug 10 /var/log/samba/log.winbindd shows many lines with random garbage pid: [2023/08/25 10:03:49.898994, 10, pid=158296, effective(0, 0), real(0, 0), class=winbind] ../../source3/winbindd/winbindd_dual.c:885(winbind_msg_relay_fn) winbind_msg_relay_fn: sending message to pid 1037686087. [2023/08/25 10:03:49.899010, 3, pid=158296, effective(0, 0), real(0, 0)] ../../source3/lib/util_procid.c:53(pid_to_procid) pid_to_procid: messaging_dgm_get_unique failed: No such file or directory In this scenario we dereference only a garbage PID, but if we would dereference some garbage pointer we would segfault. Signed-off-by: Pavel Filipenský <pfilipen...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> commit b13d4370d2bbf6efc92ee6bb97efaa74eb9536d1 Author: Pavel Filipenský <pfilipen...@samba.org> Date: Thu Aug 24 15:42:12 2023 +0200 s3:winbindd: Avoid doing the same assignment twice Done already in setup_child(): child->domain = domain Signed-off-by: Pavel Filipenský <pfilipen...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml | 1 + source3/winbindd/winbindd_domain.c | 3 +-- source3/winbindd/winbindd_dual.c | 4 ++-- source3/winbindd/winbindd_ndr.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml index be39143eb08..5cd846e0a31 100644 --- a/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml +++ b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml @@ -11,6 +11,7 @@ Setting this parameter to a value greater than 1 can improve scalability with many simultaneous winbind requests, some of which might be slow. + Changing this value requires a restart of winbindd. </para> <para> Note that if <smbconfoption name="winbind offline logon"/> is set to diff --git a/source3/winbindd/winbindd_domain.c b/source3/winbindd/winbindd_domain.c index b1027735c8a..4c8aa9a278f 100644 --- a/source3/winbindd/winbindd_domain.c +++ b/source3/winbindd/winbindd_domain.c @@ -29,9 +29,8 @@ void setup_domain_child(struct winbindd_domain *domain) { int i; - for (i=0; i<lp_winbind_max_domain_connections(); i++) { + for (i=0; i<talloc_array_length(domain->children); i++) { setup_child(domain, &domain->children[i], "log.wb", domain->name); - domain->children[i].domain = domain; } } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index dadae1d3eda..313e11f149c 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -62,7 +62,7 @@ static void forall_domain_children(bool (*fn)(struct winbindd_child *c, for (d = domain_list(); d != NULL; d = d->next) { int i; - for (i = 0; i < lp_winbind_max_domain_connections(); i++) { + for (i = 0; i < talloc_array_length(d->children); i++) { struct winbindd_child *c = &d->children[i]; bool ok; @@ -434,7 +434,7 @@ static struct winbindd_child *choose_domain_child(struct winbindd_domain *domain struct winbindd_child *current; int i; - for (i=0; i<lp_winbind_max_domain_connections(); i++) { + for (i=0; i<talloc_array_length(domain->children); i++) { size_t shortest_len, current_len; current = &domain->children[i]; diff --git a/source3/winbindd/winbindd_ndr.c b/source3/winbindd/winbindd_ndr.c index 7b48ddb2b90..a52a704c024 100644 --- a/source3/winbindd/winbindd_ndr.c +++ b/source3/winbindd/winbindd_ndr.c @@ -154,7 +154,7 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr, ndr_print_uint32(ndr, "sequence_number", r->sequence_number); ndr_print_NTSTATUS(ndr, "last_status", r->last_status); ndr_print_winbindd_cm_conn(ndr, "conn", &r->conn); - for (i=0; i<lp_winbind_max_domain_connections(); i++) { + for (i=0; i<talloc_array_length(r->children); i++) { ndr_print_winbindd_child(ndr, "children", &r->children[i]); } ndr_print_ptr(ndr, "check_online_event", r->check_online_event); -- Samba Shared Repository