mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-23 18:37:49 +00:00
Fix the counting of supplementary groups on AIX.
We should not assume that basegid will be present in the list of gids returned by getgrset().
This commit is contained in:
parent
194968eaf0
commit
731e796711
@ -144,6 +144,7 @@ sudo_getgrouplist2_v1(const char *name, GETGROUPS_T basegid,
|
|||||||
/* Dynamically-sized group vector, count groups and alloc. */
|
/* Dynamically-sized group vector, count groups and alloc. */
|
||||||
grpsize = 1; /* reserve one for basegid */
|
grpsize = 1; /* reserve one for basegid */
|
||||||
if (*grset != '\0') {
|
if (*grset != '\0') {
|
||||||
|
grpsize++; /* at least one supplementary group */
|
||||||
for (cp = grset; *cp != '\0'; cp++) {
|
for (cp = grset; *cp != '\0'; cp++) {
|
||||||
if (*cp == ',')
|
if (*cp == ',')
|
||||||
grpsize++;
|
grpsize++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user