mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Deal with OSes where sizeof(gid_t) < sizeof(int).
This commit is contained in:
3
parse.c
3
parse.c
@@ -222,7 +222,8 @@ display_privs(v, pw)
|
||||
if (pw != sudo_user.pw) {
|
||||
(void) initgroups(pw->pw_name, pw->pw_gid);
|
||||
if ((user_ngroups = getgroups(0, NULL)) > 0) {
|
||||
user_groups = erealloc3(user_groups, user_ngroups, sizeof(gid_t));
|
||||
user_groups = erealloc3(user_groups, user_ngroups,
|
||||
MAX(sizeof(gid_t), sizeof(int)));
|
||||
if (getgroups(user_ngroups, user_groups) < 0)
|
||||
log_error(USE_ERRNO|MSG_ONLY, "can't get group vector");
|
||||
} else
|
||||
|
Reference in New Issue
Block a user