diff options
author | Eric Blake <ebb9@byu.net> | 2009-11-12 08:51:45 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-11-13 07:16:23 -0700 |
commit | 08e6b4c6ba690adba619a3c1695bc312d3e98136 (patch) | |
tree | 702aa4c1c0ac18a73a2bd3e87e696e3f83766bdf /modules/getgroups-tests | |
parent | 43b085b1a469982e97638ded20fc2262387f1655 (diff) | |
download | gnulib-08e6b4c6ba690adba619a3c1695bc312d3e98136.tar.gz |
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>
Diffstat (limited to 'modules/getgroups-tests')
-rw-r--r-- | modules/getgroups-tests | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/getgroups-tests b/modules/getgroups-tests new file mode 100644 index 0000000000..f879e494b2 --- /dev/null +++ b/modules/getgroups-tests @@ -0,0 +1,12 @@ +Files: +tests/test-getgroups.c + +Depends-on: +progname + +configure.ac: + +Makefile.am: +TESTS += test-getgroups +check_PROGRAMS += test-getgroups +test_getgroups_LDADD = $(LDADD) @LIBINTL@ |