From: Ralph Boehme Date: Mon, 12 Mar 2018 16:09:34 +0000 (+0100) Subject: winbindd: add retry to _wbint_LookupSids() X-Git-Tag: talloc-2.1.12~172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2cd2d3f3137e27cd6e4cabd34f27b49251f078d;p=thirdparty%2Fsamba.git winbindd: add retry to _wbint_LookupSids() Bug: https://bugzilla.samba.org/show_bug.cgi?id=13332 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c index f7f01431c91..4df2c5388c9 100644 --- a/source3/winbindd/winbindd_dual_srv.c +++ b/source3/winbindd/winbindd_dual_srv.c @@ -99,6 +99,7 @@ NTSTATUS _wbint_LookupSids(struct pipes_struct *p, struct wbint_LookupSids *r) struct winbindd_domain *domain = wb_child_domain(); struct lsa_RefDomainList *domains = r->out.domains; NTSTATUS status; + bool retry = false; if (domain == NULL) { return NT_STATUS_REQUEST_NOT_ACCEPTED; @@ -110,6 +111,7 @@ NTSTATUS _wbint_LookupSids(struct pipes_struct *p, struct wbint_LookupSids *r) * and winbindd_ad call into lsa_lookupsids anyway. Caching is * done at the wbint RPC layer. */ +again: status = rpc_lookup_sids(p->mem_ctx, domain, r->in.sids, &domains, &r->out.names); @@ -117,7 +119,11 @@ NTSTATUS _wbint_LookupSids(struct pipes_struct *p, struct wbint_LookupSids *r) r->out.domains = domains; } - reset_cm_connection_on_error(domain, NULL, status); + if (!retry && reset_cm_connection_on_error(domain, NULL, status)) { + retry = true; + goto again; + } + return status; }