getgroups: fix logic error
authorEric Blake <ebb9@byu.net>
Thu, 12 Nov 2009 15:51:45 +0000 (08:51 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 14:16:23 +0000 (07:16 -0700)
commit08e6b4c6ba690adba619a3c1695bc312d3e98136
tree702aa4c1c0ac18a73a2bd3e87e696e3f83766bdf
parent43b085b1a469982e97638ded20fc2262387f1655
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]