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,