diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-04 00:55:15 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-05-04 17:36:50 -0700 |
commit | 9909a175bf1602e7bb4ebfc1c9befeaa56da1fb4 (patch) | |
tree | 9b9db8ccb9017daf91d73164af5ede7905ec9360 /tests/nixos/default.nix | |
parent | 8dfb30a2355be667fcb947ea995669c801534fbf (diff) |
Fix /etc/group having desynced IDs from the actual UID in the sandbox
This was found when `logrotate.conf` failed to build in a NixOS system
with:
/nix/store/26zdl4pyw5qazppj8if5lm8bjzxlc07l-coreutils-9.3/bin/id: cannot find name for group ID 30000
This was surprising because it seemed to mean that /etc/group was busted
in the sandbox. Indeed it was:
root:x:0:
nixbld:!:100:
nogroup:x:65534:
We diagnosed this to sandboxUid() being called before
usingUserNamespace() was called, in setting up /etc/group inside the
sandbox. This code desperately needs refactoring.
We also moved the /etc/group code to be with the /etc/passwd code, but
honestly this code is all spaghetti'd all over the place and needs some
more serious tidying than we did here.
We also moved some checks to be earlier to improve locality with where
the things they are checking come from.
Change-Id: Ie29798771f3593c46ec313a32960fa955054aceb
Diffstat (limited to 'tests/nixos/default.nix')
-rw-r--r-- | tests/nixos/default.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/nixos/default.nix b/tests/nixos/default.nix index 3d0a1f0c6..987463b07 100644 --- a/tests/nixos/default.nix +++ b/tests/nixos/default.nix @@ -164,4 +164,6 @@ in symlinkResolvconf = runNixOSTestFor "x86_64-linux" ./symlink-resolvconf.nix; rootInSandbox = runNixOSTestFor "x86_64-linux" ./root-in-sandbox; + + broken-userns = runNixOSTestFor "x86_64-linux" ./broken-userns.nix; } |