prometheus/exporters: fix regression in DynamicUser behavior

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 fbb7e0c82f.
This commit is contained in:
Pierre Bourdon 2018-12-05 04:24:37 +01:00 committed by Robin Gloster
parent 199b4c4743
commit 3873f43fc3

View file

@ -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;
});