SUSE Support

Here When You Need Us

getgroups() reads through all group sources

This document (3479315) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 10 SP1
SUSE Linux Enterprise Server 10

Situation

/etc/nsswitch.conf has been modified to get group information from more than one source, for example:

group: files [SUCCESS=return] ldap

However, despite the group of a user requested exists in /etc/group, the other source (LDAP, in this case) gets requested as well. This could lead to programs like id, which call getgroups(2), hang for quite a while if the LDAP server isn't ready, or programs that execute initgroups(3) to not start up correctly (for example, OpenLDAP itself.)

Resolution

Use [!NOTFOUND=return] instead of [SUCCESS=return] to stop accessing the following modules.

Additional Information

When looking for additional group ownership of a user, a SUCCESS status of a libnss_* module would stop the search as soon as one group is found in that module. However, additional groups may be present in the other modules, thus the module returns a different (undocumented) return code instead ofSUCCESSin this case. The negated NOTFOUND catches this reliably. Please note that all groups of a user must be specified completely in one of the sources, not spreaded among them, otherwise the user would have incomplete group ownerships.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:3479315
  • Creation Date: 22-Nov-2007
  • Modified Date:10-Mar-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.