2
0
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:
Todd C. Miller
2007-08-14 19:27:27 +00:00
parent dd3e80180f
commit c939690786
2 changed files with 3 additions and 2 deletions

View File

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