summary refs log tree commit diff
AgeCommit message (Collapse)Author
2015-07-02Typo nixEelco Dolstra
2015-07-02Preserve supplementary groups of build usersLudovic Courtès
The following patch is an attempt to address this bug (see <http://bugs.gnu.org/18994>) by preserving the supplementary groups of build users in the build environment. In practice, I would expect that supplementary groups would contain only one or two groups: the build users group, and possibly the “kvm” group. [Changed &at(0) to data() and removed tabs - Eelco]
2015-07-02GC: Handle ENOSPC creating/moving to the trash directoryEelco Dolstra
Issue #564.
2015-07-02Use posix_fallocate to create /nix/var/nix/db/reservedEelco Dolstra
2015-07-02Make /nix/var/nix/db/reserved biggerEelco Dolstra
Issue #564.
2015-07-02Export outputPaths functionEelco Dolstra
This is useful for the new hydra-queue-runner.
2015-07-02Use std::vector::data()Eelco Dolstra
2015-07-02Allow substitutes for builds that have preferLocalBuild setEelco Dolstra
Not substituting builds with "preferLocalBuild = true" was a bad idea, because it didn't take the cost of dependencies into account. For instance, if we can't substitute a fetchgit call, then we have to download/build git and all its dependencies. Partially reverts 5558652709f27e8a887580b77b93c705659d7a4b and adds a new derivation attribute "allowSubstitutes" to specify whether a derivation may be substituted.
2015-06-03Don't let unprivileged users repair pathsEelco Dolstra
2015-06-03Add a ‘verifyStore’ RPCLudovic Courtès
Hello! The patch below adds a ‘verifyStore’ RPC with the same signature as the current LocalStore::verifyStore method. Thanks, Ludo’. >From aef46c03ca77eb6344f4892672eb6d9d06432041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org> Date: Mon, 1 Jun 2015 23:17:10 +0200 Subject: [PATCH] Add a 'verifyStore' remote procedure call.
2015-06-03Revert /nix/store permission back to 01775Eelco Dolstra
This broke NixOS VM tests. Mostly reverts 27b7b94923d2f207781b438bb7a57669bddf7d2b, 5ce50cd99e740d0d0f18c30327ae687be9356553, afa433e58c3fe6029660a43fdc2073c9d15b4210.
2015-06-03Chroot builds: Provide world-readable /nix/storeEelco Dolstra
This was causing NixOS VM tests to fail mysteriously since 5ce50cd99e740d0d0f18c30327ae687be9356553. Nscd could (sometimes) no longer read /etc/hosts: open("/etc/hosts", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) Probably there was some wacky interaction between the guest kernel and the 9pfs implementation in QEMU.
2015-06-03addToStore(): Take explicit name argumentEelco Dolstra
2015-06-03Tighten permissions on chroot directoriesEelco Dolstra
2015-06-03Fix typos: s/the the/the/Daniel Hahler
2015-06-03Use chroots for all derivationsEelco Dolstra
If ‘build-use-chroot’ is set to ‘true’, fixed-output derivations are now also chrooted. However, unlike normal derivations, they don't get a private network namespace, so they can still access the network. Also, the use of the ‘__noChroot’ derivation attribute is no longer allowed. Setting ‘build-use-chroot’ to ‘relaxed’ gives the old behaviour. Note for Guix: unlike Nix commit 99897f6, we keep 'settings.useChroot'.
2015-06-03Use pivot_root in addition to chroot when possibleHarald van Dijk
chroot only changes the process root directory, not the mount namespace root directory, and it is well-known that any process with chroot capability can break out of a chroot "jail". By using pivot_root as well, and unmounting the original mount namespace root directory, breaking out becomes impossible. Non-root processes typically have no ability to use chroot() anyway, but they can gain that capability through the use of clone() or unshare(). For security reasons, these syscalls are limited in functionality when used inside a normal chroot environment. Using pivot_root() this way does allow those syscalls to be put to their full use.
2015-06-03Simplify parseHash32Eelco Dolstra
2015-06-03Simplify printHash32Eelco Dolstra
2015-06-03Doh^2Eelco Dolstra
2015-06-03DohEelco Dolstra
2015-06-03Set /nix/store permission to 1737Eelco Dolstra
I.e., not readable to the nixbld group. This improves purity a bit for non-chroot builds, because it prevents a builder from enumerating store paths (i.e. it can only access paths it knows about).
2015-06-03libutil: Limit readLink() error to only overflows.aszlig
Let's not just improve the error message itself, but also the behaviour to actually work around the ntfs-3g symlink bug. If the readlink() call returns a smaller size than the stat() call, this really isn't a problem even if the symlink target really has changed between the calls. So if stat() reports the size for the absolute path, it's most likely that the relative path is smaller and thus it should also work for file system bugs as mentioned in 93002d69fc58c2b71e2dfad202139230c630c53a. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Tested-by: John Ericson <Ericson2314@Yahoo.com>
2015-06-03libutil: Improve errmsg on readLink size mismatch.aszlig
A message like "error: reading symbolic link `...' : Success" really is quite confusing, so let's not indicate "success" but rather point out the real issue. We could also limit the check of this to just check for non-negative values, but this would introduce a race condition between stat() and readlink() if the link target changes between those two calls, thus leading to a buffer overflow vulnerability. Reported by @Ericson2314 on IRC. Happened due to a possible ntfs-3g bug where a relative symlink returned the absolute path (st_)size in stat() while readlink() returned the relative size. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Tested-by: John Ericson <Ericson2314@Yahoo.com>
2015-06-03PedantryEelco Dolstra
2015-06-03Explicitly include required C headersMarko Durkovic
2015-06-03Better error messageEelco Dolstra
2015-06-03Silence some warnings on GCC 4.9Eelco Dolstra
2015-06-03Shut up a Valgrind warningEelco Dolstra
2015-06-03Fix some memory leaksEelco Dolstra
2015-06-03Ensure we're writing to stderr in the builderEelco Dolstra
http://hydra.nixos.org/build/17862041
2015-06-03Get rid of unnecessary "interrupted by the user" message with -vvvEelco Dolstra
2015-06-03Remove tabsEelco Dolstra
2015-06-03Use PR_SET_PDEATHSIG to ensure child cleanupEelco Dolstra
2015-06-03Rename 'initChild' to 'runChild'.Ludovic Courtès
This is similar to commit b5ed5b6 in upstream Nix.
2015-05-11Don't wait for PID -1Eelco Dolstra
The pid field can be -1 if forking the substituter process failed.
2015-05-11Build derivations in a more predictable orderEelco Dolstra
Derivations are now built in order of derivation name, so a package named "aardvark" is built before "baboon". Fixes #399.
2015-05-11Don't create unnecessary substitution goals for derivationsEelco Dolstra
2015-05-11Disable vacuuming the DB after garbage collectionEelco Dolstra
Especially in WAL mode on a highly loaded machine, this is not a good idea because it results in a WAL file of approximately the same size ad the database, which apparently cannot be deleted while anybody is accessing it.
2015-05-11nix-daemon: Call exit(), not _exit()Eelco Dolstra
This was preventing destructors from running. In particular, it was preventing the deletion of the temproot file for each worker process. It may also have been responsible for the excessive WAL growth on Hydra (due to the SQLite database not being closed properly). Apparently broken by accident in 8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74.
2015-05-11Clean up temp roots in a more C++ wayEelco Dolstra
2015-05-11Fix messageEelco Dolstra
2015-05-11Don't use ADDR_LIMIT_3GBEelco Dolstra
This gives 32-bit builds on x86_64-linux more memory.
2015-05-11Make ~DerivationGoal more reliableEelco Dolstra
2015-05-11nix-store --gc: Don't warn about missing manifests directoryEelco Dolstra
2015-05-11Improve error message if the daemon worker fails to startEelco Dolstra
2015-05-11Fix build on gcc < 4.7Shea Levy
2015-05-11Improved error message when encountering unsupported file typesEelco Dolstra
Fixes #269.
2015-05-11Remove some duplicate codeEelco Dolstra
2015-05-11createDirs(): Handle ‘path’ being a symlinkEelco Dolstra
In particular, this fixes "nix-build -o /tmp/result" on Mac OS X (where /tmp is a symlink).