aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-01-02Allow $NIX_PAGER to override $PAGEREelco Dolstra
2015-01-02libutil: 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-01-02libutil: 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>
2014-12-29LocalStore initialization: Don't die if build-users-group doesn't existShea Levy
See NixOS/nixpkgs@9245516
2014-12-23Revive running builds in a PID namespaceEelco Dolstra
2014-12-14PedantryEelco Dolstra
2014-12-14Merge branch 'cygwin-master' of https://github.com/ternaris/nixEelco Dolstra
2014-12-13Better error messageEelco Dolstra
2014-12-12Silence some warnings on GCC 4.9Eelco Dolstra
2014-12-12Shut up a Valgrind warningEelco Dolstra
2014-12-12Fix some memory leaksEelco Dolstra
2014-12-12Ensure we're writing to stderr in the builderEelco Dolstra
http://hydra.nixos.org/build/17862041
2014-12-12Don't abort if we get a signal while waiting for the pagerEelco Dolstra
2014-12-12Get rid of unnecessary "interrupted by the user" message with -vvvEelco Dolstra
2014-12-12Remove chatty messageEelco Dolstra
This broke building with "-vv", because the builder is not allowed to write to stderr at this point.
2014-12-12DohEelco Dolstra
2014-12-12Remove tabsEelco Dolstra
2014-12-12Remove dead codeEelco Dolstra
2014-12-12Remove canary stuffEelco Dolstra
2014-12-10Provide default pagersEelco Dolstra
Borrowed from systemd.
2014-12-10Don't do vfork in conjunction with setuidEelco Dolstra
2014-12-10Use vforkEelco Dolstra
2014-12-10Rename functionEelco Dolstra
2014-12-10Don't wait for PID -1Eelco Dolstra
The pid field can be -1 if forking the substituter process failed.
2014-12-10Revert "Use posix_spawn to run the pager"Eelco Dolstra
This reverts commit d34d2b2bbf784c0bb420a50905af25e02c6e4989.
2014-12-10builtins.readFile: realise context associated with the pathShea Levy
2014-12-09Explicitly include required C headersMarko Durkovic
2014-12-05Define ‘environ’Eelco Dolstra
http://hydra.nixos.org/build/17690555
2014-12-05Use posix_spawn to run the pagerEelco Dolstra
In low memory environments, "nix-env -qa" failed because the fork to run the pager hit the kernel's overcommit limits. Using posix_spawn gets around this. (Actually, you have to use posix_spawn with the undocumented POSIX_SPAWN_USEVFORK flag, otherwise it just uses fork/exec...)
2014-12-02Make all ExternalValueBase functions constShea Levy
2014-12-02Allow external code using libnixexpr to add typesShea Levy
Code that links to libnixexpr (e.g. plugins loaded with importNative, or nix-exec) may want to provide custom value types and operations on values of those types. For example, nix-exec is currently using sets where a custom IO value type would be more appropriate. This commit provides a generic hook for such types in the form of tExternal and the ExternalBase virtual class, which contains all functions necessary for libnixexpr's type-polymorphic functions (e.g. `showType`) to be implemented.
2014-11-25Add a primop for regular expression pattern matchingEelco Dolstra
The function ‘builtins.match’ takes a POSIX extended regular expression and an arbitrary string. It returns ‘null’ if the string does not match the regular expression. Otherwise, it returns a list containing substring matches corresponding to parenthesis groups in the regex. The regex must match the entire string (i.e. there is an implied "^<pat>$" around the regex). For example: match "foo" "foobar" => null match "foo" "foo" => [] match "f(o+)(.*)" "foooobar" => ["oooo" "bar"] match "(.*/)?([^/]*)" "/dir/file.nix" => ["/dir/" "file.nix"] match "(.*/)?([^/]*)" "file.nix" => [null "file.nix"] The following example finds all regular files with extension .nix or .patch underneath the current directory: let findFiles = pat: dir: concatLists (mapAttrsToList (name: type: if type == "directory" then findFiles pat (dir + "/" + name) else if type == "regular" && match pat name != null then [(dir + "/" + name)] else []) (readDir dir)); in findFiles ".*\\.(nix|patch)" (toString ./.)
2014-11-25forceString(): Accept pos argumentEelco Dolstra
2014-11-24Build 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.
2014-11-24Don't create unnecessary substitution goals for derivationsEelco Dolstra
2014-11-20import derivation: cleanupShea Levy
Before this there was a bug where a `find` was being called on a not-yet-sorted set. The code was just a mess before anyway, so I cleaned it up while fixing it.
2014-11-19Disable 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.
2014-11-19nix-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.
2014-11-19Clean up temp roots in a more C++ wayEelco Dolstra
2014-11-17Fix messageEelco Dolstra
2014-11-15realiseContext: Handle all context typesShea Levy
Avoids an assertion
2014-11-15Add functors (callable attribute sets).Shea Levy
With this, attribute sets with a `__functor` attribute can be applied just like normal functions. This can be used to attach arbitrary metadata to a function without callers needing to treat it specially.
2014-11-14Don't use ADDR_LIMIT_3GBEelco Dolstra
This gives 32-bit builds on x86_64-linux more memory.
2014-11-12Make ~DerivationGoal more reliableEelco Dolstra
2014-11-04nix-store --gc: Don't warn about missing manifests directoryEelco Dolstra
2014-10-31nix-daemon: Get peer credentials on Mac OS XEelco Dolstra
This makes allowed-users and trusted-users work on Mac OS X.
2014-10-31Improve error message if the daemon worker fails to startEelco Dolstra
2014-10-31Fix more warningsEelco Dolstra
2014-10-31Shut up a clang warningEelco Dolstra
2014-10-29Remove comments claiming we use a private PID namespaceEelco Dolstra
This is no longer the case since 524f89f1399724e596f61faba2c6861b1bb7b9c5.