Bugzilla – Bug 1215487
add support for nsswitch.conf dropins
Last modified: 2023-10-31 08:00:35 UTC
nsswitch.conf is a rather monolithic file at the moment. It's not possible to extend specific entries. To modify it, one has to copy the whole file to /etc and edit it there. That doesn't fly for OS vendors that need to ship any OS files in /usr. We'd need a more flexible solution that allows to have snippets in both /etc and /usr to extend settings. Off the bat I could think of something like this: usr └── etc └── nsswitch.conf.d ├── hosts │ ├── 10-mymachines │ ├── 20-resolved │ ├── 50-files │ └── 60-dns └── passwd ├── 10-compat └── 20-systemd # head usr/etc/nsswitch.conf.d/*/* ==> usr/etc/nsswitch.conf.d/hosts/10-mymachines <== mymachines ==> usr/etc/nsswitch.conf.d/hosts/20-resolved <== resolve [!UNAVAIL=return] ==> usr/etc/nsswitch.conf.d/hosts/50-files <== files ==> usr/etc/nsswitch.conf.d/hosts/60-dns <== dns ==> usr/etc/nsswitch.conf.d/passwd/10-compat <== compat ==> usr/etc/nsswitch.conf.d/passwd/20-systemd <== systemd