struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct winbindd_domain *domain,
const struct dom_sid *sid)
{
struct tevent_req *req, *subreq;
struct wb_lookupusergroups_state *state;
+ struct winbindd_domain *domain;
NTSTATUS status;
req = tevent_req_create(mem_ctx, &state,
return tevent_req_post(req, ev);
}
+ domain = find_domain_from_sid_noinit(&state->sid);
+ if (domain == NULL) {
+ char buf[DOM_SID_STR_BUFLEN];
+ dom_sid_string_buf(&state->sid, buf, sizeof(buf));
+ DEBUG(1,("could not find domain entry for sid %s\n", buf));
+ tevent_req_nterror(req, NT_STATUS_NO_SUCH_DOMAIN);
+ return tevent_req_post(req, ev);
+ }
+
subreq = dcerpc_wbint_LookupUserGroups_send(
state, ev, dom_child_handle(domain), &state->sid, &state->sids);
if (tevent_req_nomem(subreq, req)) {
struct winbindd_response *response);
struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct winbindd_domain *domain,
const struct dom_sid *sid);
NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
int *num_sids, struct dom_sid **sids);