diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/winbindd/winbindd_sids_to_xids.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/winbindd/winbindd_sids_to_xids.c')
-rw-r--r-- | source3/winbindd/winbindd_sids_to_xids.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_sids_to_xids.c b/source3/winbindd/winbindd_sids_to_xids.c index 52d473b58f..d08064fbf3 100644 --- a/source3/winbindd/winbindd_sids_to_xids.c +++ b/source3/winbindd/winbindd_sids_to_xids.c @@ -80,12 +80,12 @@ struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx, DEBUG(10, ("num_sids: %d\n", (int)state->num_sids)); - state->cached = TALLOC_ZERO_ARRAY(state, struct id_map, + state->cached = talloc_zero_array(state, struct id_map, state->num_sids); if (tevent_req_nomem(state->cached, req)) { return tevent_req_post(req, ev); } - state->non_cached = TALLOC_ARRAY(state, struct dom_sid, + state->non_cached = talloc_array(state, struct dom_sid, state->num_sids); if (tevent_req_nomem(state->non_cached, req)) { return tevent_req_post(req, ev); @@ -171,13 +171,12 @@ static void winbindd_sids_to_xids_lookupsids_done(struct tevent_req *subreq) status = wb_lookupsids_recv(subreq, state, &state->domains, &state->names); TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return; } state->ids.num_ids = state->num_non_cached; - state->ids.ids = TALLOC_ARRAY(state, struct wbint_TransID, + state->ids.ids = talloc_array(state, struct wbint_TransID, state->num_non_cached); if (tevent_req_nomem(state->ids.ids, req)) { return; @@ -202,7 +201,7 @@ static void winbindd_sids_to_xids_lookupsids_done(struct tevent_req *subreq) break; }; t->domain_index = n->sid_index; - sid_peek_rid(&state->sids[i], &t->rid); + sid_peek_rid(&state->non_cached[i], &t->rid); t->unix_id = (uint64_t)-1; } @@ -269,6 +268,9 @@ NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req, } } else { unix_id = state->ids.ids[num_non_cached].unix_id; + if (unix_id == -1) { + found = false; + } switch(state->ids.ids[num_non_cached].type) { case WBC_ID_TYPE_UID: type = 'U'; |