aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinter Cute <winter@winter.cafe>2024-07-20 22:14:33 +0000
committerGerrit Code Review <gerrit@localhost>2024-07-20 22:14:33 +0000
commit1917e6c765b0b0012ed85a7a927db0bf83fb27ca (patch)
treeb21299027c275ecbe3244120530b5fadc368cf70
parent72ee25b4025257fdaab7b8e8d5d1ccc83858fdab (diff)
parent3da41fdb829c2b2085cf9c9ae268f3bee5d5594f (diff)
Merge "Fix namespace warning being emitted if sandbox is disabled" into main
-rw-r--r--src/libstore/build/local-derivation-goal.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 5ca8eac95..660512e49 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -221,12 +221,12 @@ void LocalDerivationGoal::tryLocalBuild()
}
#if __linux__
- // FIXME: should user namespaces being unsupported also require
- // sandbox-fallback to be allowed? I don't think so, since they aren't a
- // huge security win to have enabled.
- usingUserNamespace = userNamespacesSupported();
-
if (useChroot) {
+ // FIXME: should user namespaces being unsupported also require
+ // sandbox-fallback to be allowed? I don't think so, since they aren't a
+ // huge security win to have enabled.
+ usingUserNamespace = userNamespacesSupported();
+
if (!mountAndPidNamespacesSupported()) {
if (!settings.sandboxFallback)
throw Error("this system does not support the kernel namespaces that are required for sandboxing; use '--no-sandbox' to disable sandboxing. Pass --debug for diagnostics on what is broken.");