nixos/ldap: set proper User= and Group= for nslcd service
eb90d970 broke nslcd, as /run/nslcd was created/chowned as root user, while nslcd wants to do parts as nslcd user. This commit changes the nslcd to run with the proper uid/gid from the start (through User= and Group=), so the RuntimeDirectory has proper permissions, too. In some cases, secrets are baked into nslcd's config file during startup (so we don't want to provide it from the store). This config file is normally hard-wired to /etc/nslcd.conf, but we don't want to use PermissionsStartOnly anymore (#56265), and activation scripts are ugly, so redirect /etc/nslcd.conf to /run/nslcd/nslcd.conf, which now gets provisioned inside ExecStartPre=. This change requires the files referenced to in users.ldap.bind.passwordFile and users.ldap.daemon.rootpwmodpwFile to be readable by the nslcd user (in the non-nslcd case, this was already the case for users.ldap.bind.passwordFile) fixes #57783
parent
0a1451af
Please register or sign in to comment