getgroups: fix logic error The replacement getgroups mistakenly failed with EINVAL if there were more than 20 groups, since -1 < n_groups. Also, realloc geometrically rather than linearly. * lib/getgroups.c (rpl_getgroups): Don't fail if current process has more than 20 groups. * modules/getgroups-tests: New test. * tests/test-getgroups.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>