aboutsummaryrefslogtreecommitdiffhomepage
path: root/test.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-01-01 21:34:57 +0900
committerOphestra <cat@gensokyo.uk>2025-01-01 21:34:57 +0900
commit6acd0d4e88af6a80836c5409023bbb6ebc57231f (patch)
treec0b5ab89cb7549e817c5dac9c0894279ac376275 /test.nix
parent35b714231768d11b82e575701ca5c7a081e2c542 (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.nix21
1 files changed, 16 insertions, 5 deletions
diff --git a/test.nix b/test.nix
index c7692ba1..d25a1879 100644
--- a/test.nix
+++ b/test.nix
@@ -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")