Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
prometheus/exporters: fix regression in DynamicUser behavior
Browse files Browse the repository at this point in the history
Instead of setting User/Group only when DynamicUser is disabled, the
previous version of the code set it only when it was enabled. This
caused services with DynamicUser enabled to actually run as nobody, and
services without DynamicUser enabled to run as root.

Regression from fbb7e0c.
  • Loading branch information
delroth authored and globin committed Dec 5, 2018
1 parent 199b4c4 commit 3873f43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/monitoring/prometheus/exporters.nix
Expand Up @@ -127,7 +127,7 @@ let
serviceConfig.Restart = mkDefault "always";
serviceConfig.PrivateTmp = mkDefault true;
serviceConfig.WorkingDirectory = mkDefault /tmp;
} serviceOpts ] ++ optional (serviceOpts.serviceConfig.DynamicUser or false) {
} serviceOpts ] ++ optional (!(serviceOpts.serviceConfig.DynamicUser or false)) {
serviceConfig.User = conf.user;
serviceConfig.Group = conf.group;
});
Expand Down

0 comments on commit 3873f43

Please sign in to comment.