getgroups: work around FreeBSD bug
authorEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 19:53:17 +0000 (12:53 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 15 Nov 2009 03:17:16 +0000 (03:17 +0000)
commit867cf3bc81870ba2896b5c2098e76b458c057a14
tree4037a011b54afb4b1e0ad9f7adc047d928a97061
parent5390af1423eab9623205ddd259668ca123c07dd7
getgroups: work around FreeBSD bug

FreeBSD 7.2 mistakenly succeeds on getgroups(-1,ptr) (POSIX
requires EINVAL failure since -1 is less than the proper result).

* lib/getgroups.c (rpl_getgroups): Work around the bug.
* m4/getgroups.m4 (gl_FUNC_GETGROUPS): Detect the bug.
* doc/posix-functions/getgroups.texi (getgroups): Document it.
* tests/test-getgroups.c (main): Fix buffer overrun.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/getgroups.texi
lib/getgroups.c
m4/getgroups.m4
tests/test-getgroups.c