summary refs log tree commit diff
path: root/nixos/modules/services/scheduling
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien@users.noreply.github.com>2021-09-18 15:28:49 +0000
committerGitHub <noreply@github.com>2021-09-18 15:28:49 +0000
commitceb2e6667b064ce5130f751d7b6625a81e191dec (patch)
tree25580706229710dd815d1d228474488331eb6b6e /nixos/modules/services/scheduling
parenta92dd171bae2db6eeff74a3d31fa99e47e793359 (diff)
parent27b0c53d237b6c0411dc5798376b0ba6fbad0df0 (diff)
downloadnixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar.gz
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar.bz2
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar.lz
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar.xz
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.tar.zst
nixpkgs-ceb2e6667b064ce5130f751d7b6625a81e191dec.zip
Merge pull request #126289 from rnhmjoj/wrappers
nixos/security/wrappers: make well-typed
Diffstat (limited to 'nixos/modules/services/scheduling')
-rw-r--r--nixos/modules/services/scheduling/cron.nix7
-rw-r--r--nixos/modules/services/scheduling/fcron.nix3
2 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix
index 3bc31832946..c28956b3bfe 100644
--- a/nixos/modules/services/scheduling/cron.nix
+++ b/nixos/modules/services/scheduling/cron.nix
@@ -93,7 +93,12 @@ in
 
     { services.cron.enable = mkDefault (allFiles != []); }
     (mkIf (config.services.cron.enable) {
-      security.wrappers.crontab.source = "${cronNixosPkg}/bin/crontab";
+      security.wrappers.crontab =
+        { setuid = true;
+          owner = "root";
+          group = "root";
+          source = "${cronNixosPkg}/bin/crontab";
+        };
       environment.systemPackages = [ cronNixosPkg ];
       environment.etc.crontab =
         { source = pkgs.runCommand "crontabs" { inherit allFiles; preferLocalBuild = true; }
diff --git a/nixos/modules/services/scheduling/fcron.nix b/nixos/modules/services/scheduling/fcron.nix
index 42bed21bf25..acaa995f739 100644
--- a/nixos/modules/services/scheduling/fcron.nix
+++ b/nixos/modules/services/scheduling/fcron.nix
@@ -136,10 +136,13 @@ in
         owner = "fcron";
         group = "fcron";
         setgid = true;
+        setuid = false;
       };
       fcronsighup = {
         source = "${pkgs.fcron}/bin/fcronsighup";
+        owner = "root";
         group = "fcron";
+        setuid = true;
       };
     };
     systemd.services.fcron = {