NGROUPS_MAX

Ben Lindstrom mouring at etoh.eviladmin.org
Wed Sep 25 23:01:30 EST 2002


However, a lot of platforms don't support sysconf() and I since we are
heading into a lock I think we should hold off breaking platforms until
next release.

- Ben

On 25 Sep 2002, Sven Rudolph wrote:

> Currently openssh (3.4p1) relies on the NGROUPS_MAX define. This makes
> the number of allowed simultaneous (per-user) secondary groups a
> compile-time decision.
>
> $ find . -name \*.c | xargs grep NGROUPS_MAX
> ./groupaccess.c:static char *groups_byname[NGROUPS_MAX + 1];    /* +1 for base/primary group */
> ./groupaccess.c:        gid_t groups_bygid[NGROUPS_MAX + 1];
> ./uidswap.c:static gid_t        saved_egroups[NGROUPS_MAX], user_groups[NGROUPS_MAX];
> ./uidswap.c:    saved_egroupslen = getgroups(NGROUPS_MAX, saved_egroups);
> ./uidswap.c:            user_groupslen = getgroups(NGROUPS_MAX, user_groups);
>
> POSIX defined sysconf in order to avoid this.
>
> By using sysconf(_SC_NGROUPS_MAX) this value is determined at
> run-time.
>
> 	Sven
> _______________________________________________
> openssh-unix-dev at mindrot.org mailing list
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
>




More information about the openssh-unix-dev mailing list