idmap_nss: Do not return SID from unixids_to_sids on type mismatch
authorChristof Schmitt <cs@samba.org>
Fri, 5 Mar 2021 23:07:54 +0000 (16:07 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 31 Mar 2021 09:22:17 +0000 (09:22 +0000)
commit3f366878d33cf977230137021f6376936b2a1862
treec2cdd84745da0f58726352abce26a48e3b2d513e
parentaf37d5abae924d095e7b35620d850cf1f19021c4
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

(cherry picked from commit 0e789ba1802ca22e5a01abd6e93ef66cd45566a7)
source3/winbindd/idmap_nss.c