mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Addressing PR feedback
This commit is contained in:
parent
9de070e620
commit
e92b8402b0
70 changed files with 320 additions and 510 deletions
|
@ -898,38 +898,23 @@ in
|
|||
|
||||
# Capabilities won't work unless we have at-least a 4.3 Linux
|
||||
# kernel because we need the ambient capability
|
||||
security.permissionsWrappers.setcap = mkIf (versionAtLeast (getVersion config.boot.kernelPackages.kernel) "4.3") (
|
||||
[
|
||||
{ program = "ping";
|
||||
source = "${pkgs.iputils.out}/bin/ping";
|
||||
capabilities = "cap_net_raw+p";
|
||||
}
|
||||
security.wrappers = mkIf (versionAtLeast (getVersion config.boot.kernelPackages.kernel) "4.3") {
|
||||
ping = {
|
||||
source = "${pkgs.iputils.out}/bin/ping";
|
||||
capabilities = "cap_net_raw+p";
|
||||
};
|
||||
|
||||
{ program = "ping6";
|
||||
source = "${pkgs.iputils.out}/bin/ping6";
|
||||
capabilities = "cap_net_raw+p";
|
||||
}
|
||||
]
|
||||
);
|
||||
ping6 = {
|
||||
source = "${pkgs.iputils.out}/bin/ping6";
|
||||
capabilities = "cap_net_raw+p";
|
||||
};
|
||||
};
|
||||
|
||||
# If our linux kernel IS older than 4.3, let's setuid ping and ping6
|
||||
security.permissionsWrappers.setuid = mkIf (versionOlder (getVersion config.boot.kernelPackages.kernel) "4.3") (
|
||||
[
|
||||
{ program = "ping";
|
||||
source = "${pkgs.iputils.out}/bin/ping";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
setuid = true;
|
||||
}
|
||||
|
||||
{ program = "ping6";
|
||||
source = "${pkgs.iputils.out}/bin/ping6";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
setuid = true;
|
||||
}
|
||||
]
|
||||
);
|
||||
# If the linux kernel IS older than 4.3, create setuid wrappers
|
||||
# for ping and ping6
|
||||
security.setuidPrograms = mkIf (versionOlder (getVersion config.boot.kernelPackages.kernel) "4.3") [
|
||||
"ping" "ping6"
|
||||
];
|
||||
|
||||
# Set the host and domain names in the activation script. Don't
|
||||
# clear it if it's not configured in the NixOS configuration,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue