idmap_nss: Do not return SID from unixids_to_sids on type mismatch
commit0e789ba1802ca22e5a01abd6e93ef66cd45566a7
authorChristof Schmitt <cs@samba.org>
Fri, 5 Mar 2021 23:07:54 +0000 (5 16:07 -0700)
committerVolker Lendecke <vl@samba.org>
Thu, 11 Mar 2021 08:38:41 +0000 (11 08:38 +0000)
treefbe6795ba0ae85ef4b1c2d4f94eb8661905dd6f7
parent79dd4b133c37451c98fe7f7c45da881e89e91ffc
idmap_nss: 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>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Mar 11 08:38:41 UTC 2021 on sn-devel-184
source3/winbindd/idmap_nss.c