What we want here is, for failed lookupsids, pass the domain name of the
SID we were trying to lookup to the idmap backend.
But as a domain member, using
state->single_domains[state->single_sids_done]
for this purpose will always be use our primary domain name (for S-1-5-21
SIDs that are not in our local SAM).
So for now use find_domain_from_sid_noinit() to find the domain from the
domain list. This can be removed when we switch idmap backend
determination to be based on domain SIDs, not names.
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11961
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
&domain_name, &name);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
- struct wb_lookupsids_domain *wb_domain;
+ struct winbindd_domain *wb_domain = NULL;
const char *tmpname;
type = SID_NAME_UNKNOWN;
- wb_domain = state->single_domains[state->single_sids_done];
+ res_sid_index = state->single_sids[state->single_sids_done];
+ wb_domain = find_domain_from_sid_noinit(&state->sids[res_sid_index]);
if (wb_domain != NULL) {
/*
* If the lookupsid failed because the rid not
* name in the idmap backend to figure out
* which domain to use in processing.
*/
- tmpname = wb_domain->domain->name;
+ tmpname = wb_domain->name;
} else {
tmpname = "";
}