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
* 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