summaryrefslogtreecommitdiff
path: root/modules/mgetgroups
Commit message (Collapse)AuthorAgeFilesLines
* free-posix: use more often in other modulesPaul Eggert2021-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us simplify cleanup code that calls ‘free’. * lib/amemxfrm.c (amemxfrm): * lib/areadlink-with-size.c (areadlink_with_size): * lib/areadlinkat-with-size.c (areadlinkat_with_size): * lib/astrxfrm.c (astrxfrm): * lib/dprintf.c (dprintf): * lib/execute.c (execute): * lib/execvpe.c (execvpe): * lib/fchdir.c (get_name): * lib/file-has-acl.c (file_has_acl): * lib/fprintf.c (fprintf): * lib/getcwd-lgpl.c (rpl_getcwd): * lib/getgroups.c (rpl_getgroups): * lib/link.c (link, rpl_link): * lib/linkat.c (link_immediate, link_follow, linkat_follow): * lib/localename.c (newlocale, duplocale): * lib/mgetgroups.c (mgetgroups): * lib/mountlist.c (read_file_system_list): * lib/pipe-filter-gi.c (pipe_filter_gi_close): * lib/putenv.c (_unsetenv, putenv): * lib/read-file.c (read_file): * lib/rename.c (rpl_rename): * lib/savedir.c (streamsavedir, savedir): * lib/spawni.c (do_open, __spawni): * lib/spawn-pipe.c (create_pipe): * lib/striconv.c (mem_cd_iconv, str_cd_iconv, str_iconv): * lib/striconveh.c (mem_cd_iconveh_internal, str_cd_iconveh) (mem_iconveh, str_iconveh): * lib/supersede.c (open_supersede, close_supersede): * lib/vasnprintf.c (VASNPRINTF): * lib/vdprintf.c (vdprintf): * lib/vfprintf.c (vfprintf): * lib/wcscoll-impl.h (wcscoll): * lib/wcsxfrm-impl.h (wcsxfrm): * lib/xgetdomainname.c (xgetdomainname): * lib/xgethostname.c (xgethostname): Simplify by assuming that ‘free’ preserves errno. * lib/localename.c: Do not include errno.h. * modules/amemxfrm, modules/areadlink-with-size: * modules/areadlinkat-with-size, modules/astrxfrm: * modules/c-vasnprintf, modules/dprintf, modules/execute: * modules/execvpe, modules/fchdir, modules/file-has-acl: * modules/fprintf-posix, modules/getcwd-lgpl, modules/getgroups: * modules/link, modules/linkat, modules/localename: * modules/mgetgroups, modules/mountlist, modules/pipe-filter-gi: * modules/posix_spawn-internal, modules/putenv, modules/read-file: * modules/rename, modules/savedir, modules/spawn-pipe: * modules/striconv, modules/striconveh, modules/supersede: * modules/vasnprintf, modules/vdprintf, modules/vfprintf-posix: * modules/wcscoll, modules/wcsxfrm, modules/xgetdomainname: * modules/xgethostname: Depend on free-posix.
* mgetgroups: remove dependency on realloc-gnuPaul Eggert2013-10-131-1/+1
| | | | | | | | | | | The dependency violates the comment in realloc-gnu, which says that tests can't depend on realloc-gnu; some tests depend on mgetgroups, so mgetgroups can't depend on realloc-gnu. Problem reported by Daniel Richard G. in <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00056.html>. * lib/mgetgroups.c (mgetgroups): Don't call realloc (NULL, 0). * modules/mgetgroups (Depends-on): Depend on realloc-posix, not realloc-gnu.
* mgetgroups: relax license to LGPLv2+Eric Blake2013-07-031-1/+1
| | | | | | | | | | | | | | getgrouplist is part of glibc and LGPLv2+; the mgetgroups module is merely an ease-of-use wrapper around this interface. There's nothing in the algorithm worth protecting by the more-restrictive GPLv3+. See also this thread. https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00092.html * modules/getugroups (License): Change from GPLv3+. * modules/mgetgroups (License): Likewise. * modules/getgroups (License): Change from LGPLv3+. Signed-off-by: Eric Blake <eblake@redhat.com>
* mgetgroups: Move AC_LIBOBJ invocations to module description.Bruno Haible2011-06-161-0/+1
| | | | | * m4/mgetgroups.m4 (gl_MGETGROUPS): Remove AC_LIBOBJ invocation. * modules/mgetgroups (Makefile.am): Augment lib_SOURCES.
* hash, mgetgroups: drop xalloc dependencyEric Blake2011-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Rely on the new xalloc-oversized module to avoid requiring xalloc-die for functions documented as returning NULL on potential allocation overflow. * lib/hash.c (includes): Adjust includes. * lib/mgetgroups.c (includes): Likewise. (xgetgroups): Move... * lib/xgetgroups.c: ...to new file. * modules/xgetgroups: New file, split from... * modules/mgetgroups: ...here. (Depends-on): Add xalloc-oversized. * modules/hash (Depends-on): Likewise. * modules/hash-tests (Depends-on): Drop xalloc. (test_hash_LDADD): Drop unused library. * tests/test-hash.c (main): Break xalloc dependency. (includes): Drop unused include. Signed-off-by: Eric Blake <eblake@redhat.com>
* Rename module 'realloc' -> 'realloc-gnu'.Bruno Haible2010-08-281-1/+1
|
* mgetgroups: add xgetgroups, and avoid ENOSYS failuresEric Blake2009-12-041-0/+1
| | | | | | | | | | | | | | | 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>
* mgetgroups: new module, taken from coreutilsEric Blake2009-11-131-0/+26
Wrapper function that makes using getgroups/getugroups easier to use. As part of the move from coreutils, convert GETGROUPS_T to gid_t, and allow mgetgroups(NULL,getegid(),&list) as a way to ensure that the effective gid is in the list. * modules/mgetgroups: New file. * lib/mgetgroups.h: Likewise. * lib/mgetgroups.c (mgetgroups): Likewise. * m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise. * MODULES.html.sh (Users and groups): Mention it. Signed-off-by: Eric Blake <ebb9@byu.net>