about summary refs log tree commit diff
path: root/grp/initgroups.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove 'grp' and merge into 'nss' and 'posix'Arjun Shankar2023-10-241-218/+0
| | | | | | | | | | | | | | The majority of grp routines are entry points for nss functionality. This commit removes the 'grp' subdirectory and moves all nss-relevant functionality and all tests to 'nss', and the 'setgroups' stub into 'posix' (alongside the 'getgroups' stub). References to grp/ are accordingly changed. In addition, compat-initgroups.c, a fallback implementation of initgroups is renamed to initgroups-fallback.c so that the build system does not confuse it for nss_compat/compat-initgroups.c. Build time improves very slightly; e.g. down from an average of 45.5s to 44.5s on an 8-thread mobile x86_64 CPU. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Fix all the remaining misspellings -- BZ 25337Paul Pluzhnikov2023-06-021-1/+1
|
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* nsswitch: handle missing actions properlyDJ Delorie2020-12-141-2/+4
| | | | | | | | | | | | | Some internal functions need to know if a database has a nonzero list of actions; success getting the database does not guarantee that. Add checks for such as needed. Skip the ":" in each nsswitch.conf line so as not to add a dummy action libnss_:.so See also https://bugzilla.redhat.com/show_bug.cgi?id=1906066 Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* nsswitch: use new internal API (callers)DJ Delorie2020-12-041-23/+14
| | | | | | Stitch new ABI and types throughout all NSS callers. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Remove --enable-obsolete-nsl configure flagPetr Vorel2020-07-081-7/+1
| | | | | | | | | | | | | | | | | | | this means that *always* libnsl is only built as shared library for backward compatibility and the NSS modules libnss_nis and libnss_nisplus are not built at all, libnsl's headers aren't installed. This compatibility is kept only for architectures and ABIs that have been added in or before version 2.28. Replacement implementations based on TIRPC, which additionally support IPv6, are available from <https://github.com/thkukuk/>. This change does not affect libnss_compat which does not depended on libnsl since 2.27 and thus can be used without NIS. libnsl code depends on Sun RPC, e.g. on --enable-obsolete-rpc (installed libnsl headers use installed Sun RPC headers), which will be removed in the following commit.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* nss: Turn __nss_database_lookup into a compatibility symbolFlorian Weimer2019-05-151-4/+4
| | | | | | | | | | | | | The function uses the internal service_user type, so it is not really usable from the outside of glibc. Rename the function to __nss_database_lookup2 for internal use, and change __nss_database_lookup to always indicate failure to the caller. __nss_next already was a compatibility symbol. The new implementation always fails and no longer calls __nss_next2. unscd, the alternative nscd implementation, does not use __nss_database_lookup, so it is not affected by this change.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* [BZ #20271] Add newlines in __libc_fatal calls.Paul Pluzhnikov2018-08-311-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Remove compat from DEFAULT_CONFIG lookup stringsSteve Ellcey2017-09-121-1/+7
| | | | | | | | | | | | | | | * grp/initgroups.c: Include config.h. (DEFAULT_CONFIG): New macro. (internal_getgrouplist): Use DEFAULT_CONFIG. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nss/nsswitch.c (__nss_disable_nscd): Likewise. (DEFAULT_DEFCONFIG): New macro. (__nss_database_lookup): Use DEFAULT_DEFCONFIG. * nss/grp-lookup.c: Include config.h (DEFAULT_CONFIG): Set definition based on LINK_OBSOLETE_NSL. * nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise. * nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise. * manual/nss.texi: Update default values section.
* Mark internal nss symbols with attribute_hidden [BZ #18822]H.J. Lu2017-08-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark internal nss symbols with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. Tested on x86-64 with and without --disable-nscd. [BZ #18822] * grp/initgroups.c (__nss_group_database): Removed. (__nss_initgroups_database): Likewise. * nscd/gai.c (__nss_hosts_database): Likewise. * nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Likewise. * posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484.c (__nss_hosts_database): Likewise. * sysdeps/posix/getaddrinfo.c (__nss_hosts_database): Likewise. * nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Add attribute_hidden. * nss/nsswitch.c (__nss_database_custom): Define only if USE_NSCD is defined. (__nss_configure_lookup): Use __nss_database_custom only if USE_NSCD is defined. * nss/nsswitch.h (__nss_database_custom): Declare only if USE_NSCD is defined. Add attribute_hidden. (__nss_setent): Add attribute_hidden. (__nss_endent): Likewise. (__nss_getent_r): Likewise. (__nss_getent): Likewise. (DEFINE_DATABASE): Declare __nss_##arg##_database.
* NSS: Replace exported NSS lookup functions with stubs [BZ #21962]Florian Weimer2017-08-141-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 384ca551743318bd9c9e24a496d6397f2e3f2a49 from 2007 added this to nss/XXX-lookup.c: +#ifndef NO_COMPAT +int +internal_function attribute_compat_text_section +DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp) +{ + return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp); +} +#endif That is, it adds a pseudo-compat function with an internal_function attribute. The function it was supposed to replace did not have the attribute: extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name, - void **fctp) internal_function; + const char *fct2_name, void **fctp) + internal_function; This changed the calling convention on i386 for the following functions in the public ABI: __nss_passwd_lookup __nss_group_lookup __nss_hosts_lookup This commit replaces the functions with always-failing stubs, with true compat symbols. Due to a happy accident, the calling convention of the stub is identical for the internal_function and non-internal_function case on i386. In addition, this commit auto-generates the __nss_*_lookup2 function declarations as part of <nsswitch.h>.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* grp: Rewrite to use struct scratch_buffer instead of extend_allocaFlorian Weimer2015-04-081-1/+1
| | | | | grp/compat-initgroups.c is included from nscd/initgrcache.c, which is why the #include directive has to be added there as well.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-2/+2
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers2013-01-011-2/+1
|
* Suppress incorrect link warnings for NSS symbolsChris Metcalf2012-10-301-2/+2
| | | | | | | | | When glibc is built with --enable-static-nss, the warning that using NSS symbols requires the nss shared objects to be present is no longer true, as those symbols are built into libc. Suppress the warning for those symbols by providing a new macro (nss_interface_function) for the NSS functions that is defined as static_link_warning in the normal case, and empty for static NSS.
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Correctly handle missing initgroups databaseAndreas Schwab2011-10-171-8/+4
|
* Fix handling of initgroups database.Ulrich Drepper2011-06-151-7/+12
|
* More configurability for secondary group lookupUlrich Drepper2011-05-101-14/+31
| | | | | | | | | | | | | Together with a previous patch which introduced the initgroups entry in nsswitch.conf this patch allows more customization of the lookups for initgroups/getgrouplist. Nothing changes if the groups entry in nsswitch.conf is used. If the initgroups entry is used instead the code now doesn't automatically continue looking for more entries aftedr a successful lookup. Instead the normal rules are followed which do specify that by default no more service is consulted. This can be overwritten with [SUCCESS=continue] appropriately placed in the line.
* Add finer grained control for initgroups lookups to NSS.Ulrich Drepper2011-04-291-2/+3
|
* Add self-contained test for NSS.Ulrich Drepper2010-08-111-2/+3
| | | | | While at it fix interaction between __nss_configure_lookup and nscd. Otherwise the test fails if nscd is runnung.
* * grp/initgroups.c (internal_getgrouplist): Don't prematurelyUlrich Drepper2008-10-301-8/+3
| | | | abort if there is no initgroups_dyn function.
* [BZ #2883]Ulrich Drepper2006-08-031-0/+1
| | | | | * sysvipc/sys/msg.h: Change return value to ssize_t. * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
* (getgrouplist): Simplify code a bit. Don't allocate one additionalUlrich Drepper2006-08-031-1/+1
| | | | element on NEWGROUPS.
* * grp/initgroups.c (internal_getgrouplist): Remove unnecessaryUlrich Drepper2006-08-031-17/+11
| | | | | test introduced in patch for bz #661. (getgrouplist): Simplify code a bit.
* [BZ #661]Roland McGrath2005-03-291-2/+4
| | | | | | | | | | | 2005-03-19 Bruno Haible <bruno@clisp.org> * intl/dcigettext.c (struct known_translation_t): Change type of domainname field to 'const char *'. (DCIGETTEXT): Remove const-cast. [BZ #661] * grp/initgroups.c (internal_getgrouplist): Check if we have enough space before adding the primary group to the list.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-12/+15
|
* 2.5-18.1Jakub Jelinek2007-07-121-15/+12
|
* Update.Ulrich Drepper2004-10-051-3/+20
| | | | | | | | 2004-10-05 Ulrich Drepper <drepper@redhat.com> * grp/initgroups.c: Remove duplicate group IDs. * grp/compat-initgroups.c: Likewise. * nscd/initgrcache.c: Likewise.
* Update.Ulrich Drepper2004-09-301-95/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | * grp/initgroups.c: Move compat_call implementation... * grp/compat-initgroups.c: ...to here. New file. * grp/Makefile (distribute): Add compat-initgroups.c. (CFLAGS-initgroups.c): Add -DUSE_NSCD=1. * mscd/initgrcache.c: New file. * nscd/nscd_initgroups.c: New file. * nscd/Makefile (routines): Add nscd_initgroups. (nscd-modules): Add initgrcache. * nscd/cache.c (prune_cache): Add support for INITGROUPS entries. * nscd/connections.c: Handle INITGROUPS requests. * nscd/nscd-client.h: Define INITGROUPS, initgr_response_header. Add initgrdata element to struct datahead. Fix typo in comment. * nscd/nscd_proto.h: Declare __nscd_getgrouplist. Fix parameter type in __nscd_getgrgrid_r. * nscd/selinux.c (perms): Add INITGROUPS entry. * nscd/nscd_getai.c: No need to include <sys/mman.h>. * sunrpc/get_myaddr.c (get_myaddress): Account for interfaces without assigned addresses. * sunrpc/pmap_clnt.c (__get_myaddress): Likewise. * sunrpc/pmap_rmt.c (getbroadcastnets): Likewise. * sunrpc/clnt_udp.c (is_network_up): Likewise.
* Update.Ulrich Drepper2004-03-301-6/+5
| | | | | | | | | | 2004-03-30 Ulrich Drepper <drepper@redhat.com> * nis/nss_nis/nis-initgroups.c: Implement getting the information from the netid.byname map if the system administrator allows this. * grp/initgroups.c (initgroups): Limit the initial allocation to 64 entries to not allocate too much on systems with really high limits.
* Update.Ulrich Drepper2003-06-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-06-16 Thorsten Kukuk <kukuk@suse.de> * include/libc-symbols.h: Add static_link_warning macro. * grp/initgroups.c: Print linker warning if this function is called in a static linked binary. * nss/getXXbyYY.c: Likewise. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. 2003-06-16 Bruno Haible <bruno@clisp.org> * iconvdata/gconv-modules (ISO-8859-15): Add aliases ISO_8859-15, LATIN-9. (ISO-8859-16): Add aliases ISO_8859-16:2001, ISO_8859-16. (IBM1047): Add alias IBM-1047. (GBK): Add aliases MS936, WINDOWS-936. 2003-06-16 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Define even if defined __ASSUME_STAT64_SYSCALL && defined XSTAT_IS_XSTAT64. (__xstat64_conv): Change xstat_conv to __xstat_conv. Reported by Arnaud Desitter <arnaud.desitter@geography.oxford.ac.uk>.
* Update.Ulrich Drepper2003-04-231-3/+5
| | | | | | | | | | 2003-04-23 Ulrich Drepper <drepper@redhat.com> * grp/initgroups.c (getgrouplist): Don't copy too much into the user buffer if more groups are found than fit into it. * nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups_dyn): Use extend_alloca.
* Update.Ulrich Drepper2002-03-131-2/+2
| | | | * grp/initgroups.c (__nss_group_data): Declare as hidden.
* * nss/nsswitch.c (__nss_next): Don't use __FUNCTION__ as literal.Roland McGrath2001-12-171-2/+2
| | | | * grp/initgroups.c (internal_getgrouplist): Likewise.
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-8/+8
| | | | | | | | | | | | | | 2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
* Update.Ulrich Drepper2001-06-161-40/+79
| | | | | | | | | | | | | | | 2001-06-07 Mark Kettenis <kettenis@gnu.org> * grp/initgroups.c (initgroups): Factor out re-usable code into... (internal_getgrouplist): ... new function. (getgrouplist): New function. * grp/grp.h (getgrouplist): New prototype. * grp/Versions [2.2.4]: Add getgrouplist. 2001-06-16 Ulrich Drepper <drepper@redhat.com> * inet/netinet/ip6.h: Fix comments in ip6_hdr. Patch by Pekka Savola <pekkas@netcore.fi>.
* * grp/initgroups.c (initgroups) [NGROUPS_MAX != 0]: Always use sysconfRoland McGrath2001-04-171-9/+9
| | | | | | | | instead of the constant NGROUPS_MAX. That way, the limit can be raised in the kernel configuration without having to recompile libc. * sysdeps/posix/euidaccess.c: Don't #include <limits.h> or try to define NGROUPS_MAX; we don't use it here.
* Update.Ulrich Drepper2000-08-241-0/+2
| | | | | * grp/initgroups.c (initgroups): Deallocate groups array. Reported by jani.raiha@sonera.com [PR libc/1868].