diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-31 16:48:45 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-31 16:48:45 -0400 |
commit | f4ec483382e167469def497422dbb30fee5f5f32 (patch) | |
tree | 2706e91b09ed2a560dc89cd8ce0bd78eeecbafac /nss/getent.c | |
parent | 0ffc4f3ebaace42cd545db55a2ac50b6e0cc7d89 (diff) | |
download | glibc-f4ec483382e167469def497422dbb30fee5f5f32.tar.gz glibc-f4ec483382e167469def497422dbb30fee5f5f32.tar.xz glibc-f4ec483382e167469def497422dbb30fee5f5f32.zip |
Unify getent output for initgroups database
Requests for other fail if iteration is not supported and no parameters are given. Do this for initgroups as well.
Diffstat (limited to 'nss/getent.c')
-rw-r--r-- | nss/getent.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nss/getent.c b/nss/getent.c index 7d9422373c..0e39836179 100644 --- a/nss/getent.c +++ b/nss/getent.c @@ -518,6 +518,12 @@ initgroups_keys (int number, char *key[]) size_t grpslen = ngrps * sizeof (gid_t); gid_t *grps = alloca (grpslen); + if (number == 0) + { + fprintf (stderr, _("Enumeration not supported on %s\n"), "initgroups"); + return 3; + } + for (int i = 0; i < number; ++i) { int no = ngrps; |