3
0
Fork 0
forked from mirrors/nixpkgs

nixos/virtualbox-host: Fix hardening with headless vbox

Fixes #157157.
This commit is contained in:
Zhaofeng Li 2022-10-08 15:41:17 -06:00
parent f677051b8d
commit 6ed7e545ec

View file

@ -104,16 +104,18 @@ in
group = "vboxusers";
setuid = true;
};
executables = [
"VBoxHeadless"
"VBoxNetAdpCtl"
"VBoxNetDHCP"
"VBoxNetNAT"
"VBoxVolInfo"
] ++ (lib.optionals (!cfg.headless) [
"VBoxSDL"
"VirtualBoxVM"
]);
in mkIf cfg.enableHardening
(builtins.listToAttrs (map (x: { name = x; value = mkSuid x; }) [
"VBoxHeadless"
"VBoxNetAdpCtl"
"VBoxNetDHCP"
"VBoxNetNAT"
"VBoxSDL"
"VBoxVolInfo"
"VirtualBoxVM"
]));
(builtins.listToAttrs (map (x: { name = x; value = mkSuid x; }) executables));
users.groups.vboxusers.gid = config.ids.gids.vboxusers;