2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Don't allow max_groups to be set to zero, it just complicates things

needlessly.  Fixes an assertion in visudo when there is a group-based
Defaults entry.
This commit is contained in:
Todd C. Miller
2013-08-12 09:14:38 -06:00
parent 8b4fbc5cc0
commit 9b2fb418ca
12 changed files with 29 additions and 16 deletions

View File

@@ -243,7 +243,7 @@ sudo_make_grlist_item(struct passwd *pw, char * const *unused1,
user_gids = NULL;
user_ngids = 0;
} else {
if (sudo_user.max_groups != -1) {
if (sudo_user.max_groups > 0) {
ngids = sudo_user.max_groups;
gids = emalloc2(ngids, sizeof(GETGROUPS_T));
(void)getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids);