Merge pull request #256294 from mkg20001/mkg/sudo-rs
This commit is contained in:
commit
63ae6fa5c6
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Some tests to ensure sudo is working properly.
|
# Some tests to ensure sudo is working properly.
|
||||||
{ pkgs, sudo-rs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
inherit (pkgs.lib) mkIf optionalString;
|
inherit (pkgs.lib) mkIf optionalString;
|
||||||
password = "helloworld";
|
password = "helloworld";
|
||||||
|
@ -24,7 +24,7 @@ in
|
||||||
|
|
||||||
security.sudo = {
|
security.sudo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = sudo-rs;
|
package = pkgs.sudo-rs;
|
||||||
wheelNeedsPassword = false;
|
wheelNeedsPassword = false;
|
||||||
|
|
||||||
extraRules = [
|
extraRules = [
|
||||||
|
@ -55,7 +55,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
security.sudo = {
|
security.sudo = {
|
||||||
package = sudo-rs;
|
package = pkgs.sudo-rs;
|
||||||
enable = true;
|
enable = true;
|
||||||
wheelNeedsPassword = false;
|
wheelNeedsPassword = false;
|
||||||
execWheelOnly = true;
|
execWheelOnly = true;
|
||||||
|
@ -93,5 +93,5 @@ in
|
||||||
|
|
||||||
with subtest("non-wheel users should be unable to run sudo thanks to execWheelOnly"):
|
with subtest("non-wheel users should be unable to run sudo thanks to execWheelOnly"):
|
||||||
strict.fail('faketty -- su - noadmin -c "sudo --help"')
|
strict.fail('faketty -- su - noadmin -c "sudo --help"')
|
||||||
'';;
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue