idmap_rfc2307: Do not return SID from unixids_to_sids on type mismatch
authorChristof Schmitt <cs@samba.org>
Fri, 5 Mar 2021 23:01:13 +0000 (16:01 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 31 Mar 2021 10:13:54 +0000 (10:13 +0000)
commit7628a27a96bf817dd1707b123b792e7e1689edd2
tree927dae1c253e986975c0d717041f8453100e0a14
parente7b1ee061eaa335d70dc354dfb3700f8344274c9
idmap_rfc2307: Do not return SID from unixids_to_sids on type mismatch

The call to winbind_lookup_name already wrote the result in the id_map
array. The later check for the type detected a mismatch, but that did
not remove the SID from the result struct.

Change this by first assigning the SID to a temporary variable and only
write it to the id_map array after the type checks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14663

Signed-off-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 79dd4b133c37451c98fe7f7c45da881e89e91ffc)
source3/winbindd/idmap_rfc2307.c
source3/winbindd/winbindd_dual_srv.c