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 09:22:17 +0000 (09:22 +0000)
commitaf37d5abae924d095e7b35620d850cf1f19021c4
tree12167ae40d4efe0a66c0ca5392551ceee3eb1da8
parent3aa06edf38bc4002f031476baa50712fd1a67f4d
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