summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien <pacien.trangirard@pacien.net>2023-06-05 20:04:48 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-06-06 16:30:16 +0000
commit8ebdbefc23171bea98f5e7c289ce61164c85a896 (patch)
tree6ff94e082b6cd6cddc1576eb07a1e75b72dc8b2e
parentMerge pull request #236223 from NixOS/backport-236174-to-release-23.05 (diff)
downloadnixpkgs-origin/backport-236126-to-release-23.05.tar.gz
nixos/exim: apply privilege restrictionsorigin/backport-236126-to-release-23.05
Since 816614bd62b, the service is set to use the exim user so that systemd takes care of the credentials ownership. The executable is still required to run as root, to then drop privileges. The prefix '+' that was used however interfers with the use of privilege restrictions and other sandboxing options. Since we only want to escape the "User" setting, we can use the '!' prefix instead. (cherry picked from commit 54be076ae77da1f45fbc6c88419657f828e6237e)
-rw-r--r--nixos/modules/services/mail/exim.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/exim.nix b/nixos/modules/services/mail/exim.nix
index a9504acee351..1d1258913b67 100644
--- a/nixos/modules/services/mail/exim.nix
+++ b/nixos/modules/services/mail/exim.nix
@@ -116,8 +116,8 @@ in
wantedBy = [ "multi-user.target" ];
restartTriggers = [ config.environment.etc."exim.conf".source ];
serviceConfig = {
- ExecStart = "+${cfg.package}/bin/exim -bdf -q${cfg.queueRunnerInterval}";
- ExecReload = "+${coreutils}/bin/kill -HUP $MAINPID";
+ ExecStart = "!${cfg.package}/bin/exim -bdf -q${cfg.queueRunnerInterval}";
+ ExecReload = "!${coreutils}/bin/kill -HUP $MAINPID";
User = cfg.user;
};
preStart = ''