d8307d
commit 4b7c74179c8928d971d370e1137d202f891a4cf5
d8307d
Author: Carlos O'Donell <carlos@redhat.com>
d8307d
Date:   Wed Mar 20 12:40:18 2019 -0400
d8307d
d8307d
    nss: Make nsswitch.conf more distribution friendly.
d8307d
    
d8307d
    The current default nsswitch.conf file provided by glibc is not very
d8307d
    distribution friendly. The file contains some minimal directives that no
d8307d
    real distribution uses. This update aims to provide a rich set of
d8307d
    comments which are useful for all distributions, and a broader set of
d8307d
    service defines which should work for all distributions.
d8307d
    
d8307d
    Tested defaults on x86_64 and they work. The nsswitch.conf file more
d8307d
    closely matches what we have in Fedora now, and I'll adjust Fedora to
d8307d
    use this version with minor changes to enable Fedora-specific service
d8307d
    providers.
d8307d
    
d8307d
    v2
d8307d
    - Add missing databases to manual.
d8307d
    - Add link to manual from default nsswitch.conf.
d8307d
    - Sort nsswitch.conf according to most used database first.
d8307d
    
d8307d
    v3
d8307d
    - Only mention implemented services in 'NSS Basics.'
d8307d
    - Mention 'automount' in 'Services in the NSS configuration.'
d8307d
    - Sort services in alphabetical order.
d8307d
    
d8307d
    v4
d8307d
    - Project name is 'Samba'.
d8307d
    
d8307d
    v5
d8307d
    - Fix typo in manual/nss.texi.
d8307d
    
d8307d
    v6
d8307d
    - Fix another typo in manual/nss.texi. Ran spell checker this time.
d8307d
d8307d
diff --git a/manual/nss.texi b/manual/nss.texi
d8307d
index 164ae33246..821469a78a 100644
d8307d
--- a/manual/nss.texi
d8307d
+++ b/manual/nss.texi
d8307d
@@ -56,13 +56,17 @@ functions to access the databases.
d8307d
 @noindent
d8307d
 The databases available in the NSS are
d8307d
 
d8307d
+@cindex aliases
d8307d
 @cindex ethers
d8307d
 @cindex group
d8307d
+@cindex gshadow
d8307d
 @cindex hosts
d8307d
+@cindex initgroups
d8307d
 @cindex netgroup
d8307d
 @cindex networks
d8307d
-@cindex protocols
d8307d
 @cindex passwd
d8307d
+@cindex protocols
d8307d
+@cindex publickey
d8307d
 @cindex rpc
d8307d
 @cindex services
d8307d
 @cindex shadow
d8307d
@@ -75,16 +79,22 @@ Ethernet numbers,
d8307d
 @comment @pxref{Ethernet Numbers}.
d8307d
 @item group
d8307d
 Groups of users, @pxref{Group Database}.
d8307d
+@item gshadow
d8307d
+Group passphrase hashes and related information.
d8307d
 @item hosts
d8307d
 Host names and numbers, @pxref{Host Names}.
d8307d
+@item initgroups
d8307d
+Supplementary group access list.
d8307d
 @item netgroup
d8307d
 Network wide list of host and users, @pxref{Netgroup Database}.
d8307d
 @item networks
d8307d
 Network names and numbers, @pxref{Networks Database}.
d8307d
-@item protocols
d8307d
-Network protocols, @pxref{Protocols Database}.
d8307d
 @item passwd
d8307d
 User identities, @pxref{User Database}.
d8307d
+@item protocols
d8307d
+Network protocols, @pxref{Protocols Database}.
d8307d
+@item publickey
d8307d
+Public keys for Secure RPC.
d8307d
 @item rpc
d8307d
 Remote procedure call names and numbers.
d8307d
 @comment @pxref{RPC Database}.
d8307d
@@ -96,8 +106,8 @@ User passphrase hashes and related information.
d8307d
 @end table
d8307d
 
d8307d
 @noindent
d8307d
-There will be some more added later (@code{automount}, @code{bootparams},
d8307d
-@code{netmasks}, and @code{publickey}).
d8307d
+@c We currently don't implement automount, netmasks, or bootparams.
d8307d
+More databases may be added later.
d8307d
 
d8307d
 @node NSS Configuration File, NSS Module Internals, NSS Basics, Name Service Switch
d8307d
 @section The NSS Configuration File
d8307d
@@ -159,6 +169,10 @@ these files since they should be placed in a directory where they are
d8307d
 found automatically.  Only the names of all available services are
d8307d
 important.
d8307d
 
d8307d
+Lastly, some system software may make use of the NSS configuration file
d8307d
+to store their own configuration for similar purposes.  Examples of this
d8307d
+include the @code{automount} service which is used by @code{autofs}.
d8307d
+
d8307d
 @node Actions in the NSS configuration, Notes on NSS Configuration File, Services in the NSS configuration, NSS Configuration File
d8307d
 @subsection Actions in the NSS configuration
d8307d
 
d8307d
diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
d8307d
index 39ca88bf51..f553588114 100644
d8307d
--- a/nss/nsswitch.conf
d8307d
+++ b/nss/nsswitch.conf
d8307d
@@ -1,20 +1,69 @@
d8307d
+#
d8307d
 # /etc/nsswitch.conf
d8307d
 #
d8307d
-# Example configuration of GNU Name Service Switch functionality.
d8307d
+# An example Name Service Switch config file. This file should be
d8307d
+# sorted with the most-used services at the beginning.
d8307d
 #
d8307d
+# Valid databases are: aliases, ethers, group, gshadow, hosts,
d8307d
+# initgroups, netgroup, networks, passwd, protocols, publickey,
d8307d
+# rpc, services, and shadow.
d8307d
+#
d8307d
+# Valid service provider entries include (in alphabetical order):
d8307d
+#
d8307d
+#	compat			Use /etc files plus *_compat pseudo-db
d8307d
+#	db			Use the pre-processed /var/db files
d8307d
+#	dns			Use DNS (Domain Name Service)
d8307d
+#	files			Use the local files in /etc
d8307d
+#	hesiod			Use Hesiod (DNS) for user lookups
d8307d
+#	nis			Use NIS (NIS version 2), also called YP
d8307d
+#	nisplus			Use NIS+ (NIS version 3)
d8307d
+#
d8307d
+# See `info libc 'NSS Basics'` for more information.
d8307d
+#
d8307d
+# Commonly used alternative service providers (may need installation):
d8307d
+#
d8307d
+#	ldap			Use LDAP directory server
d8307d
+#	myhostname		Use systemd host names
d8307d
+#	mymachines		Use systemd machine names
d8307d
+#	mdns*, mdns*_minimal	Use Avahi mDNS/DNS-SD
d8307d
+#	resolve			Use systemd resolved resolver
d8307d
+#	sss			Use System Security Services Daemon (sssd)
d8307d
+#	systemd			Use systemd for dynamic user option
d8307d
+#	winbind			Use Samba winbind support
d8307d
+#	wins			Use Samba wins support
d8307d
+#	wrapper			Use wrapper module for testing
d8307d
+#
d8307d
+# Notes:
d8307d
+#
d8307d
+# 'sssd' performs its own 'files'-based caching, so it should generally
d8307d
+# come before 'files'.
d8307d
+#
d8307d
+# WARNING: Running nscd with a secondary caching service like sssd may
d8307d
+# 	   lead to unexpected behaviour, especially with how long
d8307d
+# 	   entries are cached.
d8307d
+#
d8307d
+# Installation instructions:
d8307d
+#
d8307d
+# To use 'db', install the appropriate package(s) (provide 'makedb' and
d8307d
+# libnss_db.so.*), and place the 'db' in front of 'files' for entries
d8307d
+# you want to be looked up first in the databases, like this:
d8307d
+#
d8307d
+# passwd:    db files
d8307d
+# shadow:    db files
d8307d
+# group:     db files
d8307d
 
d8307d
-passwd:		db files
d8307d
-group:		db files
d8307d
-initgroups:	db [SUCCESS=continue] files
d8307d
-shadow:		db files
d8307d
-gshadow:	files
d8307d
-
d8307d
-hosts:		files dns
d8307d
-networks:	files dns
d8307d
-
d8307d
-protocols:	db files
d8307d
-services:	db files
d8307d
-ethers:		db files
d8307d
-rpc:		db files
d8307d
-
d8307d
-netgroup:	db files
d8307d
+# In alphabetical order. Re-order as required to optimize peformance.
d8307d
+aliases:    files
d8307d
+ethers:     files
d8307d
+group:      files
d8307d
+gshadow:    files
d8307d
+hosts:      files dns
d8307d
+initgroups: files
d8307d
+netgroup:   files
d8307d
+networks:   files dns
d8307d
+passwd:     files
d8307d
+protocols:  files
d8307d
+publickey:  files
d8307d
+rpc:        files
d8307d
+shadow:     files
d8307d
+services:   files