summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-02-25 14:55:00 +0100
committerKarolin Seeger <kseeger@samba.org>2019-03-12 11:25:42 +0000
commitdd9ca43d6a740ba96489015c3a9768f1c00d638f (patch)
tree1161c161b7da9456e29ec900429d27fadab73212
parentc031b9e23acc3705116460077d0d93713cb0ce24 (diff)
downloadsamba-dd9ca43d6a740ba96489015c3a9768f1c00d638f.tar.gz
winbind: Now we explicitly track if we got ids from cache
This now properly makes us use negative cache entries Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813 (cherry picked from commit 95d33ca79cc315f1a2e41cd60859ef01d6548c77)
-rw-r--r--source3/winbindd/wb_xids2sids.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c
index 5be55d59b75..55c24822925 100644
--- a/source3/winbindd/wb_xids2sids.c
+++ b/source3/winbindd/wb_xids2sids.c
@@ -243,6 +243,7 @@ static NTSTATUS wb_xids2sids_init_dom_maps_recv(struct tevent_req *req)
struct wb_xids2sids_dom_state {
struct tevent_context *ev;
struct unixid *all_xids;
+ const bool *cached;
size_t num_all_xids;
struct dom_sid *all_sids;
struct wb_xids2sids_dom_map *dom_map;
@@ -259,7 +260,10 @@ static void wb_xids2sids_dom_gotdc(struct tevent_req *subreq);
static struct tevent_req *wb_xids2sids_dom_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct wb_xids2sids_dom_map *dom_map,
- struct unixid *xids, size_t num_xids, struct dom_sid *sids)
+ struct unixid *xids,
+ const bool *cached,
+ size_t num_xids,
+ struct dom_sid *sids)
{
struct tevent_req *req, *subreq;
struct wb_xids2sids_dom_state *state;
@@ -273,6 +277,7 @@ static struct tevent_req *wb_xids2sids_dom_send(
}
state->ev = ev;
state->all_xids = xids;
+ state->cached = cached;
state->num_all_xids = num_xids;
state->all_sids = sids;
state->dom_map = dom_map;
@@ -293,7 +298,7 @@ static struct tevent_req *wb_xids2sids_dom_send(
/* out of range */
continue;
}
- if (!is_null_sid(&state->all_sids[i])) {
+ if (state->cached[i]) {
/* already mapped */
continue;
}
@@ -360,7 +365,7 @@ static void wb_xids2sids_dom_done(struct tevent_req *subreq)
/* out of range */
continue;
}
- if (!is_null_sid(&state->all_sids[i])) {
+ if (state->cached[i]) {
/* already mapped */
continue;
}
@@ -517,7 +522,7 @@ static void wb_xids2sids_init_dom_maps_done(struct tevent_req *subreq)
subreq = wb_xids2sids_dom_send(
state, state->ev, &dom_maps[state->dom_idx],
- state->xids, state->num_xids, state->sids);
+ state->xids, state->cached, state->num_xids, state->sids);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -548,6 +553,7 @@ static void wb_xids2sids_done(struct tevent_req *subreq)
state->ev,
&dom_maps[state->dom_idx],
state->xids,
+ state->cached,
state->num_xids,
state->sids);
if (tevent_req_nomem(subreq, req)) {