aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-08-29 16:11:38 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-08-29 16:11:38 +0200
commitebc4dae51761cb54c1db28cf4d328d3f2f55b758 (patch)
treed26b66aefee3e1fe5d798e178ab0b577e2dfe088 /src/nix
parent662db921e2f5bebeb0fd455aa744708468df8bfa (diff)
parent84de8210040580ce7189332b43038d52c56a9689 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/run.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 9c15b6749..01ec9a6f8 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -255,7 +255,10 @@ void chrootHelper(int argc, char * * argv)
uid_t gid = getgid();
if (unshare(CLONE_NEWUSER | CLONE_NEWNS) == -1)
- throw SysError("setting up a private mount namespace");
+ /* Try with just CLONE_NEWNS in case user namespaces are
+ specifically disabled. */
+ if (unshare(CLONE_NEWNS) == -1)
+ throw SysError("setting up a private mount namespace");
/* Bind-mount realStoreDir on /nix/store. If the latter mount
point doesn't already exists, we have to create a chroot