winbindd: use correct domain name for failed lookupsids
authorRalph Boehme <slow@samba.org>
Tue, 4 Apr 2017 12:21:25 +0000 (14:21 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 20 Apr 2017 10:23:17 +0000 (12:23 +0200)
commitb86a793c196b7e26ae0b3187824416132016d14f
treeef97c93d0fb3c3a35a00754053a15f3ff4dfb5ca
parent4c5f50c0048712cfb81d4892f25036d83d63ecde
winbindd: use correct domain name for failed lookupsids

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>
(cherry picked from commit a684df160e692710e011c4eb6795a66772025c23)
source3/winbindd/wb_lookupsids.c