annotate modules/group-member @ 12280:39be377f1765

getgroups: don't expose GETGROUPS_T to user These days, most systems already declare getgroups with gid_t*. But in the rare case that GETGROUPS_T is still int but gid_t is short, the user should not have to uglify their code; let the replacement hide all the magic. Tested by configuring with ac_cv_type_getgroups=uint64_t on a platform with 32-bit gid_t, and ignoring compiler warnings. However, since we don't replace setgroups, the GETGROUPS_T workaround is still needed there for now. * lib/getgroups.c (rpl_getgroups): Change signature. Copy array an element at a time if GETGROUPS_T is wrong size. * lib/getugroups.h (getugroups): Change signature. * lib/unistd.in.h (getgroups): Likewise. * m4/getgroups.m4 (gl_FUNC_GETGROUPS): Use replacement if signature needs fixing. * m4/getugroups.m4 (gl_GETUGROUPS): No longer need AC_TYPE_GETGROUPS. * modules/group-member (Depends-on): Add getgroups. * lib/group-member.c (group_info, get_group_info): Use gid_t. (group_member): Rely on getgroups replacement. * lib/getugroups.c (getugroups): Use gid_t. * tests/test-getgroups.c (main): Likewise. * NEWS: Mention the signature change. * doc/posix-functions/getgroups.texi (getgroups): Mention the problem with signature. * doc/glibc-functions/setgroups.texi (setgroups): Mention that GETGROUPS_T is still useful for setgroups. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Thu, 12 Nov 2009 10:19:39 -0700
parents 5a0294ce5372
children 8d8a6d8151f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4110
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 Description:
4172
5321105558d8 Add module descriptions.
Bruno Haible <bruno@clisp.org>
parents: 4110
diff changeset
2 Determine whether the current process has the permissions of a given group ID.
4110
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 Files:
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 lib/group-member.h
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 lib/group-member.c
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 m4/group-member.m4
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Depends-on:
9209
5a0294ce5372 Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents: 7497
diff changeset
10 extensions
12280
39be377f1765 getgroups: don't expose GETGROUPS_T to user
Eric Blake <ebb9@byu.net>
parents: 9209
diff changeset
11 getgroups
4110
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 xalloc
4830
410ea3e253b9 Revamp xalloc_oversized so that its count arg need not fit into size_t.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4197
diff changeset
13 stdbool
4110
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 configure.ac:
5016
7141ea4946af Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents: 4830
diff changeset
16 gl_FUNC_GROUP_MEMBER
4110
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 Makefile.am:
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 Include:
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 "group-member.h"
632b6cf5063f Module description.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
5251
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5016
diff changeset
23 License:
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5016
diff changeset
24 GPL
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5016
diff changeset
25
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4172
diff changeset
26 Maintainer:
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4172
diff changeset
27 Jim Meyering