getgroups: fix logic error
authorEric Blake <ebb9@byu.net>
Thu, 12 Nov 2009 15:51:45 +0000 (08:51 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 15 Nov 2009 03:04:32 +0000 (03:04 +0000)
commit82a192ddd8b181141a09d100bd2bfe3b6e8507cc
tree4429371a086021b874dcfc81e0c835784aeab5ae
parent3739c199af439901640e825f74eb356510f87895
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>
ChangeLog
lib/getgroups.c
modules/getgroups-tests [new file with mode: 0644]
tests/test-getgroups.c [new file with mode: 0644]