winbindd: use correct domain name for failed lookupsids
authorRalph Boehme <slow@samba.org>
Tue, 4 Apr 2017 12:21:25 +0000 (14:21 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 6 Apr 2017 18:08:19 +0000 (20:08 +0200)
commita684df160e692710e011c4eb6795a66772025c23
treeb51a42d6a53e7e522262889b6217447a8970698c
parentd8fd56a8244a3010469c27eaa3b73a2c5fbbc41f
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>
source3/winbindd/wb_lookupsids.c