diff options
author | Eric Blake <ebb9@byu.net> | 2009-12-04 08:26:23 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-12-04 18:02:53 -0700 |
commit | 3e035a5d686888e5eba0b622dac459b65cdd99d3 (patch) | |
tree | b1753cc4e7e2f916021c550f0de36a7f5f3e6589 /modules/mgetgroups | |
parent | 3425a9dd708056d5e12483dd917af0c035b8b5bc (diff) | |
download | gnulib-3e035a5d686888e5eba0b622dac459b65cdd99d3.tar.gz |
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>
Diffstat (limited to 'modules/mgetgroups')
-rw-r--r-- | modules/mgetgroups | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/mgetgroups b/modules/mgetgroups index 58ef74086a..cd249dba31 100644 --- a/modules/mgetgroups +++ b/modules/mgetgroups @@ -9,6 +9,7 @@ m4/mgetgroups.m4 Depends-on: getgroups getugroups +realloc xalloc configure.ac: |