Fix thinko in r20547.

* src/libstore/build.cc (nix::DerivationGoal::startBuilder): Fix the GID
  of the build user in /etc/passwd.
This commit is contained in:
Ludovic Courtès 2010-03-11 10:33:04 +00:00
parent 2e8eaca573
commit c752c9f41a

View file

@ -1568,15 +1568,15 @@ void DerivationGoal::startBuilder()
/* Create a /etc/passwd with entries for the build user and the /* Create a /etc/passwd with entries for the build user and the
nobody account. The latter is kind of a hack to support nobody account. The latter is kind of a hack to support
Samba-in-QEMU. For the sake of consistency with the setgroups(2) Samba-in-QEMU. */
call below, the build user has no supplementary groups. */
createDirs(chrootRootDir + "/etc"); createDirs(chrootRootDir + "/etc");
writeFile(chrootRootDir + "/etc/passwd", writeFile(chrootRootDir + "/etc/passwd",
(format( (format(
"nixbld:x:%1%:%1%:Nix build user:/:/noshell\n" "nixbld:x:%1%:%2%:Nix build user:/:/noshell\n"
"nobody:x:65534:65534:Nobody:/:/noshell\n") "nobody:x:65534:65534:Nobody:/:/noshell\n")
% (buildUser.enabled() ? buildUser.getUID() : getuid())).str()); % (buildUser.enabled() ? buildUser.getUID() : getuid())
% (buildUser.enabled() ? buildUser.getGID() : getgid())).str());
/* Bind-mount a user-configurable set of directories from the /* Bind-mount a user-configurable set of directories from the
host file system. The `/dev/pts' directory must be mounted host file system. The `/dev/pts' directory must be mounted