diff options
author | Ralph Boehme <slow@samba.org> | 2019-02-21 18:34:51 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2019-02-23 07:54:09 +0100 |
commit | f5a8bc2f945be45cdade5f70d4f975bae8337f67 (patch) | |
tree | 8141619bfb1dfc6319649d25f60c17540cde5e07 | |
parent | 0a1d1a57092828e61ecc07433d73db95ddbfa189 (diff) | |
download | samba-f5a8bc2f945be45cdade5f70d4f975bae8337f67.tar.gz |
winbindd: make a copy of xid's in wb_xids2sids_send()
This is in preparation of setting the result of the mapping in the top-
level callback wb_xids2sids_done(), not in the per-idmap-domain callback
wb_xids2sids_dom_done().
When caching the mapping we need the id-type from the backend, so we
need a way to pass up that information from wb_xids2sids_dom_done() up
to wb_xids2sids_done()
The xids array copy gets passed from wb_xids2sids_send() to
wb_xids2sids_dom_send(), so wb_xids2sids_dom_done() can then directly
update the top-level copy.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13802
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | source3/winbindd/wb_xids2sids.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c index 310a645cdff..38e581eee8d 100644 --- a/source3/winbindd/wb_xids2sids.c +++ b/source3/winbindd/wb_xids2sids.c @@ -452,9 +452,14 @@ struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx, return NULL; } state->ev = ev; - state->xids = xids; state->num_xids = num_xids; + state->xids = talloc_array(state, struct unixid, num_xids); + if (tevent_req_nomem(state->xids, req)) { + return tevent_req_post(req, ev); + } + memcpy(state->xids, xids, num_xids * sizeof(struct unixid)); + state->sids = talloc_zero_array(state, struct dom_sid, num_xids); if (tevent_req_nomem(state->sids, req)) { return tevent_req_post(req, ev); |