diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2016-12-15T14·56+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2016-12-15T14·56+0100 |
commit | ec7d498b72b0e283814c27cbc6c064496f95445d (patch) | |
tree | 542e0cfe15e0cc33727473aa9c2324ddda7f8652 | |
parent | 5278bb7c16c227d64551fc6578cb1b1b22f3b036 (diff) |
Give root a valid home directory
Some programs barf if the current user has a non-writable home directory, e.g. http://hydra.nixos.org/build/44818144.
-rw-r--r-- | src/libstore/build.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index f702433a02f2..31631ed3f356 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2010,9 +2010,9 @@ void DerivationGoal::startBuilder() Samba-in-QEMU. */ createDirs(chrootRootDir + "/etc"); - writeFile(chrootRootDir + "/etc/passwd", - "root:x:0:0:Nix build user:/:/noshell\n" - "nobody:x:65534:65534:Nobody:/:/noshell\n"); + writeFile(chrootRootDir + "/etc/passwd", fmt( + "root:x:0:0:Nix build user:%s:/noshell\n" + "nobody:x:65534:65534:Nobody:/:/noshell\n", "/tmp")); /* Declare the build user's group so that programs get a consistent view of the system (e.g., "id -gn"). */ |