1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00
Commit graph

14 commits

Author SHA1 Message Date
Samuli Thomasson
1d358ebb1c
handle buffer too small for getgrnam_r
Signed-off-by: Samuli Thomasson <samuli.thomasson@pm.me>
2025-06-05 21:29:12 +02:00
Samuli Thomasson
62cc737d19
linux: support supplementary groups with auto-allocate-uids
Add a new option "supplementary-groups" that allows specifying
additional groups to be mapped into the build sandbox and assigned as
supplementary groups for the build user.

This makes it possible to, for example, use the "kvm" group to provide
access to /dev/kvm even when auto-allocate-uids is enabled—something
that was not previously possible. It also enables use of supplementary
groups to grant sandboxed builds read-only access to secrets or other
shared resources.

Closes: https://github.com/NixOS/nix/issues/9276
Signed-off-by: Samuli Thomasson <samuli.thomasson@pm.me>
2025-06-01 09:22:24 +02:00
Eelco Dolstra
4dc419eaec Split LinuxDerivationBuilder
This restores doing seccomp/personality initialization even when
sandboxing is disabled.

https://hydra.nixos.org/build/298482132
2025-05-29 21:57:25 +02:00
Eelco Dolstra
b7fd872147 Cleanup 2025-05-29 21:39:22 +02:00
John Ericson
24f5d7a9c3 Fix warning when HAVE_EMBEDDED_SANDBOX_SHELL is not set
Clang doesn't like the double indent that is needed for the `if...else`
that is CPP'd away. Adding braces is fine in the `if...else...` case,
and fine as a naked block in the CPP'd away case, and properly-indented
both ways.
2025-05-28 12:49:13 -04:00
John Ericson
625dce659a Prepare for FreeBSD sandboxing support
This is the utility changes from #9968, which were easier to rebase
first.

I (@Ericson2314) didn't write this code; I just rebased it.

Co-Authored-By: Artemis Tosini <me@artem.ist>
Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
2025-05-27 14:54:50 -04:00
Eelco Dolstra
352ca238a9 Move cgroup support 2025-05-27 14:06:32 +02:00
Eelco Dolstra
774678b87f Get rid of tmpDirInSandbox variable 2025-05-27 14:00:21 +02:00
Eelco Dolstra
c9b55fa3f0 Move autoDelChroot 2025-05-27 14:00:16 +02:00
Eelco Dolstra
9e2151d839 Move seccomp code 2025-05-27 14:00:12 +02:00
Eelco Dolstra
b623fe8d14 Move doBind() 2025-05-27 14:00:07 +02:00
Eelco Dolstra
9f8f3968e3 Eliminate useChroot 2025-05-27 13:59:40 +02:00
Eelco Dolstra
67408807d8 Move pathsInChroot 2025-05-27 13:57:41 +02:00
Eelco Dolstra
5653bf5e0a DerivationBuilder: Move Linux/Darwin-specific code into subclasses 2025-05-27 13:42:22 +02:00