nixpkgs/nixos/modules
Jamey Sharp f7c776760b nixos/nscd: only drop privs after nss module init
NixOS usually needs nscd just to have a single place where
LD_LIBRARY_PATH can be set to include all NSS modules, but nscd is also
useful if some of the NSS modules need to read files which are only
accessible by root.

For example, nixos/modules/config/ldap.nix needs this when
  users.ldap.enable = true;
  users.ldap.daemon.enable = false;
and users.ldap.bind.passwordFile exists. In that case, the module
creates an /etc/ldap.conf which is only readable by root, but which the
NSS module needs to read in order to find out what LDAP server to
connect to and with what credentials.

If nscd is started as root and configured with the server-user option in
nscd.conf, then it gives each NSS module the opportunity to initialize
itself before dropping privileges. The initialization happens in the
glibc-internal __nss_disable_nscd function, which pre-loads all the
configured NSS modules for passwd, group, hosts, and services (but not
netgroup for some reason?) and, for each loaded module, calls an init
function if one is defined. After that finishes, nscd's main() calls
nscd_init() which ends by calling finish_drop_privileges().

There are provisions in systemd for using DynamicUser with a service
which needs to drop privileges itself, so this patch does that.
2019-07-07 08:43:41 -07:00
..
config networkmanager: Add rc-manager option 2019-07-03 09:40:05 +00:00
hardware Merge staging-next into staging 2019-06-18 11:07:56 +02:00
i18n/input-method docs: format 2018-09-29 20:51:11 -04:00
installer sd-image-raspberrypi: populateBoot -> populateFirmware 2019-06-25 20:49:34 -04:00
misc Merge pull request #62891 from jtojnar/nixos-documentation-nixos-help-use-w3m-1-by-default 2019-06-22 21:37:22 -04:00
profiles nixos/hardened: use graphene-hardened malloc by default 2019-05-07 13:45:39 +02:00
programs nixos/captive-browser: fix module 2019-06-14 20:38:33 +02:00
security FIx some malformed XML in option descriptions 2019-05-13 09:15:17 +02:00
services nixos/nscd: only drop privs after nss module init 2019-07-07 08:43:41 -07:00
system Add configurationLimit to systemd-boot to prevent running out of disk space 2019-06-22 20:11:11 +02:00
tasks nixos/zfs: Remove requestEncryptionCredentials assertion 2019-06-21 03:33:09 +02:00
testing nixos/test: remove the stateVersion statement from the test-instrumentation 2019-06-03 15:05:24 +02:00
virtualisation Merge pull request #53204 from peterhoeg/m/libvirt 2019-06-27 11:39:48 +08:00
module-list.nix Merge pull request #63551 from Steell/roon-server 2019-07-02 10:06:29 +08:00
rename.nix Revert "Merge pull request #63156 from Izorkin/phpfpm-rootless" 2019-06-28 21:47:43 -04:00