1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00
This commit is contained in:
Eelco Dolstra 2025-05-30 11:54:54 +02:00
parent 4dc419eaec
commit 908129eb22

View file

@ -2147,13 +2147,11 @@ std::unique_ptr<DerivationBuilder> makeDerivationBuilder(
} }
#ifdef __linux__ #ifdef __linux__
if (useSandbox) { if (useSandbox && !mountAndPidNamespacesSupported()) {
if (!mountAndPidNamespacesSupported()) { if (!settings.sandboxFallback)
if (!settings.sandboxFallback) throw Error("this system does not support the kernel namespaces that are required for sandboxing; use '--no-sandbox' to disable sandboxing");
throw Error("this system does not support the kernel namespaces that are required for sandboxing; use '--no-sandbox' to disable sandboxing"); debug("auto-disabling sandboxing because the prerequisite namespaces are not available");
debug("auto-disabling sandboxing because the prerequisite namespaces are not available"); useSandbox = false;
useSandbox = false;
}
} }
if (useSandbox) if (useSandbox)
@ -2163,7 +2161,7 @@ std::unique_ptr<DerivationBuilder> makeDerivationBuilder(
std::move(params)); std::move(params));
#endif #endif
if (params.drvOptions.useUidRange(params.drv)) if (!useSandbox && params.drvOptions.useUidRange(params.drv))
throw Error("feature 'uid-range' is only supported in sandboxed builds"); throw Error("feature 'uid-range' is only supported in sandboxed builds");
#ifdef __APPLE__ #ifdef __APPLE__