Hash :
3e035a5d
Author :
Date :
2009-12-04T08:26:23
mgetgroups: add xgetgroups, and avoid ENOSYS failures ENOSYS implies that there are no supplemental groups, so we can treat it the same as a return of 0 from getgroups rather than exposing failure to the user. This in turn fixes a crash in coreutils' id, which freed an uninitialized pointer. * lib/mgetgroups.h (xgetgroups): New prototype. * lib/mgetgroups.c (xgetgroups): New wrapper. (mgetgroups): Handle ENOSYS. * modules/mgetgroups (Depends-on): Add realloc. Reported by Scott Harrison <scott.gnu.2009@scottrix.co.uk>. Signed-off-by: Eric Blake <ebb9@byu.net>
Description:
Return the group IDs of a user or current process in malloc'd storage.
Files:
lib/mgetgroups.c
lib/mgetgroups.h
m4/mgetgroups.m4
Depends-on:
getgroups
getugroups
realloc
xalloc
configure.ac:
gl_MGETGROUPS
Makefile.am:
Include:
"mgetgroups.h"
License:
GPL
Maintainer:
Jim Meyering, Eric Blake