[staging] openldap: remove deprecated options, improve encapsulation#176449
[staging] openldap: remove deprecated options, improve encapsulation#176449kwohlfahrt wants to merge 9 commits intoNixOS:stagingfrom
Conversation
|
Probably conflicts due to merging #176290 |
By default, this is /run/ldapi, which is not compatible with systemd's runtime directories. Change it to /run/slapd/ldapi (in library and server). This makes `ldapi:///` work as a default socket again.
This fixes a bug I observed in deployment on a RPi, but not able to reproduce in tests.
Now that we use notify daemon type, this works safely and simplifies configuration.
This improves security, by starting the service as an unprivileged user, rather than starting as root and relying on the service to drop privileges. This requires a significant cleanup of pre-init scripts, to make use of StateDirectory and RuntimeDirectory for permissions.
This speeds up tests a bit. Also, ensure that mutable config works for manual config dir.
This addresses the original concern behind NixOS#92544
Use `openldap` for consistency between `/var/lib` and `/run`.
|
The changes to the package look alright, I haven't really ever looked at the module though. Would be nice if somebody else could review those, that knows how this module works. |
|
@mweinelt what's the best way to proceed then - should I cherry-pick those changes out to a new PR, or wait for further review here? |
|
I just landed #177084, which does the equivalent of 510650a ; this should be one fewer change to cherry-pick out :) (sorry I don't have much time for reviewing PRs right now, I learned of yours after making #177084 and decided to land as it was ready while yours seems much bigger and to still need some work at least from the review point of view) Overall my suggestion for getting that PR landed would be, if your commits are more or less independent you should probably try to split it up into multiple small PRs, that has a better chance of getting it under the "I have 5 minutes to perform a review while $stuff is compiling at work" bar that gets PRs reviewed faster :) |
|
Merged #179597, the rebased version, instead. |
Description of changes
This removes options deprecated in #94610. It also picks up a number of changes from #141240 (cc @poscat0x04), which adds a
mutableConfigoption and startsslapdunder a systemd-controlled user/group, rather than relying on the daemon to drop privileges.Tests are refactored to make them faster using the specialization mechanism, and improved to cover various use-cases (starting with an empty DB, mutable config, and immutable config). With these changes, starting with an empty DB works in the test, so this might obsolete #92544 (cc @mystfox).
A new change in this PR is to change the default Unix socket for OpenLDAP to
/run/openldap/ldapi(from/run/ldapi). The former can be created by openldap running as non-root, the latter cannot (so the default pathldapi:///did not previously work on NixOS).cc also @Mic92 , who was following #141240.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes