winbindd: remove bogus fallback to the forest root in wb_lookupsid*()
authorStefan Metzmacher <metze@samba.org>
Fri, 10 Mar 2017 14:23:36 +0000 (15:23 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 11 Mar 2017 20:05:09 +0000 (21:05 +0100)
It's the job of the domain controller in our domain
to traverse the trust chain.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/winbindd/wb_lookupsid.c

index 7ff5c1e0e22a9a6fd16bd137f5a7f0f6731fdb72..8873ebb42ce27032767f5a117d98e25e5cb01f4e 100644 (file)
@@ -71,36 +71,15 @@ static void wb_lookupsid_done(struct tevent_req *subreq)
                subreq, struct tevent_req);
        struct wb_lookupsid_state *state = tevent_req_data(
                req, struct wb_lookupsid_state);
-       struct winbindd_domain *forest_root;
        NTSTATUS status, result;
 
        status = dcerpc_wbint_LookupSid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (tevent_req_nterror(req, status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
+               tevent_req_nterror(req, status);
                return;
        }
-       if (NT_STATUS_IS_OK(result)) {
-               tevent_req_done(req);
-               return;
-       }
-
-       /*
-        * Let's try the forest root
-        */
-       forest_root = find_root_domain();
-       if ((forest_root == NULL) || (forest_root == state->lookup_domain)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
-       state->lookup_domain = forest_root;
-
-       subreq = dcerpc_wbint_LookupSid_send(
-               state, state->ev, dom_child_handle(state->lookup_domain),
-               &state->sid, &state->type, &state->domname, &state->name);
-       if (tevent_req_nomem(subreq, req)) {
-               return;
-       }
-       tevent_req_set_callback(subreq, wb_lookupsid_done, req);
+       tevent_req_done(req);
 }
 
 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,