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 fbb7e0c82f297815950e9153c21e561a704bfcd5.
This commit is contained in:
parent
199b4c4743
commit
3873f43fc3
@ -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;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user