mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
r23470: Fix supplementary group list truncation for *BSD. We need to pass
the correct group list length and only truncate to NGROUPS_MAX if it is too long.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
47cc9359aa
commit
07f562be7a
@ -1018,10 +1018,16 @@ static int sys_bsd_setgroups(gid_t primary_gid, int setlen, const gid_t *gidset)
|
||||
setlen++;
|
||||
}
|
||||
|
||||
if (setlen > max) {
|
||||
DEBUG(10, ("forced to truncate group list from %d to %d\n",
|
||||
setlen, max));
|
||||
setlen = max;
|
||||
}
|
||||
|
||||
#if defined(BROKEN_GETGROUPS)
|
||||
ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset);
|
||||
ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset);
|
||||
#else
|
||||
ret = setgroups(max, new_gidset ? new_gidset : gidset);
|
||||
ret = setgroups(setlen, new_gidset ? new_gidset : gidset);
|
||||
#endif
|
||||
|
||||
if (new_gidset) {
|
||||
|
Reference in New Issue
Block a user