diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-01-01 21:34:57 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-01-01 21:34:57 +0900 |
| commit | 6acd0d4e88af6a80836c5409023bbb6ebc57231f (patch) | |
| tree | c0b5ab89cb7549e817c5dac9c0894279ac376275 /test.nix | |
| parent | 35b714231768d11b82e575701ca5c7a081e2c542 (diff) | |
linux/std: handle fsu exit status 1
Printing "exit status 1" is confusing. This handles the ExitError and returns EACCES instead.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test.nix')
| -rw-r--r-- | test.nix | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -19,11 +19,19 @@ nixosTest { nodes.machine = { lib, pkgs, ... }: { - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; + users.users = { + alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; + untrusted = { + isNormalUser = true; + description = "Untrusted user"; + password = "foobar"; + uid = 1001; + }; }; home-manager.users.alice.home.stateVersion = "24.11"; @@ -198,6 +206,9 @@ nixosTest { machine.wait_for_file("/run/user/1000/wayland-1") machine.wait_for_file("/tmp/sway-ipc.sock") + # Deny unmapped uid: + print(machine.fail("sudo -u untrusted -i ${self.packages.${system}.fortify}/bin/fortify -v run")) + # Create fortify uid 0 state directory: machine.succeed("install -dm 0755 -o u0_a0 -g users /var/lib/fortify/u0") |
