Michael Ströder schrieb:
On 2/7/20 10:08 AM, Ludwig Nussel wrote:
Looking at nss/nsswitch.c in glibc at least it has built in defaults. Means as a first step we don't even need to ship any nsswitch.conf anymore as we can build glibc to have the right defaults for our main distros.
Which defaults would that be?
Glibc has built in defaults. Default of defaults is "files" if a datase does not define a different one: glibc/nss $ git grep DEFAULT_CONFIG XXX-lookup.c:|* DEFAULT_CONFIG - string for default conf (e.g. "dns files") *| XXX-lookup.c:#ifndef DEFAULT_CONFIG XXX-lookup.c:#define DEFAULT_CONFIG NULL XXX-lookup.c: DEFAULT_CONFIG, &DATABASE_NAME_SYMBOL) < 0) grp-lookup.c:# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" grp-lookup.c:# define DEFAULT_CONFIG "files" hosts-lookup.c:#define DEFAULT_CONFIG "dns [!UNAVAIL=return] files" key-lookup.c:#define DEFAULT_CONFIG "nis nisplus" network-lookup.c:#define DEFAULT_CONFIG "dns [!UNAVAIL=return] files" nsswitch.c:# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" nsswitch.c:# define DEFAULT_CONFIG "files" nsswitch.c: nss_load_all_libraries ("passwd", DEFAULT_CONFIG); nsswitch.c: nss_load_all_libraries ("group", DEFAULT_CONFIG); pwd-lookup.c:# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" pwd-lookup.c:# define DEFAULT_CONFIG "files" sgrp-lookup.c:#define DEFAULT_CONFIG "files" spwd-lookup.c:# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" spwd-lookup.c:# define DEFAULT_CONFIG "files" And: nsswitch.c:# define DEFAULT_DEFCONFIG "files" nsswitch.c: *ni = nss_parse_service_list (defconfig ?: DEFAULT_DEFCONFIG); Iow as of today if you delete {/usr,}/etc/nsswitch.conf you could still use the system with local databases (in /etc). Means the nsswitch.conf we shipped has been redundant all the time. Only now with the introduction of nss_usrfiles2 that fallback got broken. So instead of now shipping an nsswitch.conf that contains "files usrfiles" we could just as well not ship it at all and either a) patch aforementioned defaults to include "usrfiles" already b) patch "files" to also check /usr/etc
E.g. I'm always removing the nis map modules from my /etc/nsswitch.conf. I'm over-writing /etc/nsswitch.conf via config management.
In general: Don't put more pseudo config management into build defaults and RPM scripts!
Not sure what you are trying to say. The possibility to change any config file is not taken aways by using sane built in defaults. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.com/ SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer HRB 36809 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org