1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

auth: Fix CID 1615191 Uninitialized scalar variable

Protect against winbind successfully returning 0 groups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 20 18:25:54 UTC 2024 on atb-devel-224
This commit is contained in:
Volker Lendecke 2024-09-12 21:33:54 +02:00
parent 53750d9deb
commit 81ecdb125b

View File

@ -672,9 +672,11 @@ NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx,
* Winbind is running and the first element of the user_sids
* is the primary group.
*/
if (num_sids > 0) {
group_sid = user_sids[0];
if (num_sids == 0) {
DBG_INFO("User %s has no groups\n", unix_username);
return NT_STATUS_NO_SUCH_USER;
}
group_sid = user_sids[0];
} else {
/*
* Winbind is not running, try to create the group_sid from the