winbindd: add retry to _wbint_LookupSids()
authorRalph Boehme <slow@samba.org>
Mon, 12 Mar 2018 16:09:34 +0000 (17:09 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 15 Mar 2018 14:46:10 +0000 (15:46 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13332

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/winbindd/winbindd_dual_srv.c

index f7f01431c91f3cbe43545b6300f8d1560dcbb13d..4df2c5388c90fcda20a3fcde3f171a51e0324e31 100644 (file)
@@ -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;
 }