X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=source3%2Fwinbindd%2Fwb_seqnums.c;h=604ba00505e571b5807c8880b29103eef5b30f36;hp=e6efb9b99ab5b6c7f20735884e497bf81858aff2;hb=9ef2c7096341f849bd1b52bf92e01936c3869eee;hpb=ae6a6690d5ed55935c1fa0ad2800d83455c94382 diff --git a/source3/winbindd/wb_seqnums.c b/source3/winbindd/wb_seqnums.c index e6efb9b99ab..604ba00505e 100644 --- a/source3/winbindd/wb_seqnums.c +++ b/source3/winbindd/wb_seqnums.c @@ -98,24 +98,33 @@ static void wb_seqnums_done(struct tevent_req *subreq) for (i=0; inum_domains; i++) { if (subreq == state->subreqs[i]) { - state->subreqs[i] = NULL; - state->stati[i] = status; - if (NT_STATUS_IS_OK(status)) { - state->seqnums[i] = seqnum; - - /* - * This first assignment might be removed - * later - */ - state->domains[i]->sequence_number = seqnum; - - wcache_store_seqnum(state->domains[i]->name, - state->seqnums[i], - time(NULL)); - } break; } } + if (i < state->num_domains) { + /* found one */ + + state->subreqs[i] = NULL; + state->stati[i] = status; + if (NT_STATUS_IS_OK(status)) { + state->seqnums[i] = seqnum; + + /* + * This first assignment might be removed + * later + */ + state->domains[i]->sequence_number = seqnum; + + if (!wcache_store_seqnum(state->domains[i]->name, + state->seqnums[i], + time(NULL))) { + DEBUG(1, ("wcache_store_seqnum failed for " + "domain %s\n", + state->domains[i]->name)); + } + } + } + TALLOC_FREE(subreq); state->num_received += 1;