krebs.setuid: add support for capabilities
This commit is contained in:
parent
c5c0caa4c1
commit
f4e35a7312
@ -30,6 +30,10 @@ with import <stockholm/lib>;
|
|||||||
};
|
};
|
||||||
apply = toString;
|
apply = toString;
|
||||||
};
|
};
|
||||||
|
capabilities = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
};
|
||||||
owner = mkOption {
|
owner = mkOption {
|
||||||
default = "root";
|
default = "root";
|
||||||
type = types.enum (attrNames users);
|
type = types.enum (attrNames users);
|
||||||
@ -67,6 +71,9 @@ with import <stockholm/lib>;
|
|||||||
cp ${src} ${dst}
|
cp ${src} ${dst}
|
||||||
chown ${cfg.owner}.${cfg.group} ${dst}
|
chown ${cfg.owner}.${cfg.group} ${dst}
|
||||||
chmod ${cfg.mode} ${dst}
|
chmod ${cfg.mode} ${dst}
|
||||||
|
${optionalString (cfg.capabilities != []) /* sh */ ''
|
||||||
|
${pkgs.libcap.out}/bin/setcap ${concatMapStringsSep "," shell.escape cfg.capabilities} ${dst}
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user