setcapWrapper: add support for setting permissions

This commit is contained in:
Robin Gloster 2017-02-17 15:41:31 +01:00
parent 47ded42788
commit 070825d443
No known key found for this signature in database
GPG key ID: 5E4C836C632C2882

View file

@ -28,6 +28,7 @@ let
, source
, owner ? "nobody"
, group ? "nogroup"
, permissions ? "u+rx,g+x,o+x"
, ...
}:
assert (lib.versionAtLeast (lib.getVersion config.boot.kernelPackages.kernel) "4.3");
@ -45,7 +46,7 @@ let
${pkgs.libcap.out}/bin/setcap "cap_setpcap,${capabilities}" $wrapperDir/${program}
# Set the executable bit
chmod u+rx,g+x,o+x $wrapperDir/${program}
chmod ${permissions} $wrapperDir/${program}
'';
###### Activation script for the setuid wrappers