summaryrefslogtreecommitdiff
path: root/source3/winbindd/wb_lookupsids.c
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-04-02 14:15:33 +0200
committerJeremy Allison <jra@samba.org>2017-04-12 01:41:14 +0200
commit8220d7453fcf900eb50a2a06b46f1c7807b02ec9 (patch)
treed5ff22bfd684763da3cfe2e76916332b21723ee7 /source3/winbindd/wb_lookupsids.c
parent2eeb53890bba81a0fce18c3eb185c337c9222202 (diff)
downloadsamba-8220d7453fcf900eb50a2a06b46f1c7807b02ec9.tar.gz
winbindd: remove fallback from lookuprids
We're only calling lookuprids for our local SAM and BUILTIN domains, if that results in a failed lookup for some rid, sending it again via lookupsids() won't help, it will just fail again. If the caller wrongly had sent any other SID that is not from our SAM or BUILTIN via lookuprids(), that it is up to the caller to fix that, not us. The retry logic with going through the single sids lookup at the end added a fake domain with an empty string. The wb_lookupsids caller wb_sids2xids needed this, as it wasn't doing the needed error handling itself. As wb_sids2xids has been fixed to cope, we can just fail the lookupsids here. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/winbindd/wb_lookupsids.c')
-rw-r--r--source3/winbindd/wb_lookupsids.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/source3/winbindd/wb_lookupsids.c b/source3/winbindd/wb_lookupsids.c
index f6052a528ac..f2b2768bda6 100644
--- a/source3/winbindd/wb_lookupsids.c
+++ b/source3/winbindd/wb_lookupsids.c
@@ -586,32 +586,14 @@ static void wb_lookupsids_lookuprids_done(struct tevent_req *subreq)
NTSTATUS status, result;
struct wb_lookupsids_domain *d;
uint32_t i;
- bool fallback = false;
status = dcerpc_wbint_LookupRids_recv(subreq, state, &result);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
return;
}
-
- d = &state->domains[state->domains_done];
-
- if (NT_STATUS_IS_ERR(result)) {
- fallback = true;
- } else if (state->rid_names.num_principals != d->sids.num_sids) {
- fallback = true;
- }
-
- if (fallback) {
- for (i=0; i < d->sids.num_sids; i++) {
- uint32_t res_sid_index = d->sid_indexes[i];
-
- state->single_sids[state->num_single_sids] =
- res_sid_index;
- state->num_single_sids += 1;
- }
- state->domains_done += 1;
- wb_lookupsids_next(req, state);
+ if (NT_STATUS_LOOKUP_ERR(result)) {
+ tevent_req_nterror(req, result);
return;
}
@@ -619,6 +601,8 @@ static void wb_lookupsids_lookuprids_done(struct tevent_req *subreq)
* Look at the individual states in the translated names.
*/
+ d = &state->domains[state->domains_done];
+
sid_copy(&src_domain_sid, get_global_sam_sid());
src_domain.name.string = get_global_sam_name();
src_domain.sid = &src_domain_sid;