Commit Graph

4472 Commits

Author SHA1 Message Date
Eelco Dolstra 026f4f9ae8
macOS: Remove flags
In particular, UF_IMMUTABLE (uchg) needs to be cleared to allow the
path to be garbage-collected or optimised.

See https://github.com/NixOS/nixpkgs/issues/25819.
+       the file from being garbage-collected.

(cherry picked from commit b5bdfdef73)
2017-06-19 14:32:38 +02:00
Eelco Dolstra 11dd08f02e
macOS: Ugly hack to make the tests succeed
Sandboxes cannot be nested, so if Nix's build runs inside a sandbox,
it cannot use a sandbox itself. I don't see a clean way to detect
whether we're in a sandbox, so use a test-specific hack.

https://github.com/NixOS/nix/issues/1413
(cherry picked from commit 1888f7889b)
2017-06-19 14:28:04 +02:00
Shea Levy 3e574c3691 Merge branch '1.11-maintenance' of git://github.com/cyraxjoe/nix into 1.11-maintenance 2017-06-14 07:52:36 -04:00
Eelco Dolstra 5ac7088726
Bump version 2017-06-14 11:43:51 +02:00
Eelco Dolstra 35ea3d62dc
canonicalisePathMetaData(): Ignore security.selinux attribute
Untested, hopefully fixes #1406.

(cherry picked from commit 88b291ffc4)
2017-06-14 11:43:33 +02:00
Joel Rivera 7917494c45 Add support for the curl netrc file in nix-channel/nix-pull.
Based on the implementation in download-from-binary-cache.pl.in.
2017-06-13 18:18:20 -05:00
Eelco Dolstra 1e4885e316
Grmbl 2017-06-12 18:52:26 +02:00
Eelco Dolstra 36f363b8f0
On macOS, don't use /var/folders for TMPDIR
This broke "nix-store --serve".

(cherry picked from commit 25230a17a9)
2017-06-12 18:39:34 +02:00
Eelco Dolstra c33854513a
Remove Ubuntu 13.10 build
Seccomp is too old there.
2017-06-12 16:47:16 +02:00
Eelco Dolstra 0be5b949d3
Don't run pre-build-hook if we don't have a derivation
This fixes a build failure on OS X when using Hydra or Nix 1.12's
build-remote (since they don't copy the derivation to the build
machine).

(cherry picked from commit 7f5b750b40)
2017-06-12 16:46:31 +02:00
Eelco Dolstra c20641ce56
OS X -> macOS 2017-06-12 14:04:52 +02:00
Eelco Dolstra 0fb60e4e0f
Add 1.11.10 release notes 2017-06-12 13:56:38 +02:00
Eelco Dolstra 3414f3804c
Fix build 2017-06-12 13:55:59 +02:00
Eelco Dolstra 8e298e8ad9
Always use the Darwin sandbox
Even with "build-use-sandbox = false", we now use sandboxing with a
permissive profile that allows everything except the creation of
setuid/setgid binaries.

Based on 85e93d7b87.
2017-06-06 20:35:55 +02:00
Eelco Dolstra f534627929
Fix bad cherrypick 2017-06-06 19:52:40 +02:00
Eelco Dolstra 0ca9502264
Disable the build user mechanism on all platforms except Linux and OS X
(cherry picked from commit c8cc50d46e)
2017-06-06 19:52:24 +02:00
Eelco Dolstra bcc21744df
Bump version 2017-06-01 16:53:10 +02:00
Eelco Dolstra 833aae4509
Fix coverage job
(cherry picked from commit b4b1f4525f)
2017-06-01 16:51:32 +02:00
Eelco Dolstra aabe20bf78
RPM, Deb: Add dependency on libseccomp
(cherry picked from commit ab5834f7a1)
2017-06-01 16:51:03 +02:00
Eelco Dolstra c48697d617
Remove listxattr assertion
It appears that sometimes, listxattr() returns a different value for
the query case (i.e. when the buffer size is 0).

(cherry picked from commit 52fec8dde8)
2017-06-01 16:50:23 +02:00
Eelco Dolstra 4be5a65b39
Fix seccomp build failure on clang
Fixes

  src/libstore/build.cc:2321:45: error: non-constant-expression cannot be narrowed from type 'int' to 'scmp_datum_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]

(cherry picked from commit fe08d17934)
2017-06-01 16:50:08 +02:00
Eelco Dolstra 634d117ede
Add a seccomp rule to disallow setxattr()
(cherry picked from commit 2ac99a32da)
2017-06-01 16:50:04 +02:00
Eelco Dolstra 66618dbad5
canonicalisePathMetaData(): Remove extended attributes / ACLs
EAs/ACLs are not part of the NAR canonicalisation. Worse, setting an
ACL allows a builder to create writable files in the Nix store. So get
rid of them.

Closes #185.

(cherry picked from commit d798349ede)
2017-06-01 16:50:00 +02:00
Eelco Dolstra 1e0f1dab1e
Require seccomp only in multi-user setups
(cherry picked from commit ff6becafa8)
2017-06-01 16:49:52 +02:00
Eelco Dolstra 17da82e04d
Add test for setuid seccomp filter
(cherry picked from commit 1d9ab273ba)
2017-06-01 16:49:47 +02:00
Eelco Dolstra a2cf0f1018
Fix seccomp initialisation on i686-linux
(cherry picked from commit cf93397d3f)
2017-06-01 16:49:42 +02:00
Eelco Dolstra e296b8884e
Add a seccomp filter to prevent creating setuid/setgid binaries
This prevents builders from setting the S_ISUID or S_ISGID bits,
preventing users from using a nixbld* user to create a setuid/setgid
binary to interfere with subsequent builds under the same nixbld* uid.

This is based on aszlig's seccomp code
(47f587700d).

Reported by Linus Heckemann.

(cherry picked from commit 6cc6c15a2d)
2017-06-01 16:48:57 +02:00
Guillaume Maudoux a8d13e66ee
lexer: remove catch-all rules hiding real errors
With catch-all rules, we hide potential errors.
It turns out that a4744254 made one cath-all useless. Flex detected that
is was impossible to reach.
The other is more subtle, as it can only trigger on unfinished escapes
in unfinished strings, which only occurs at EOF.

(cherry picked from commit a143014d73)
2017-05-01 11:26:44 +02:00
Guillaume Maudoux a10bd3355a
Fix lexer to support `$'` in multiline strings.
(cherry picked from commit a474425425)
2017-05-01 11:26:41 +02:00
Eelco Dolstra 26f7e8305b
Fix hash computation when importing NARs greater than 4 GiB
This caused "nix-store --import" to compute an incorrect hash on NARs
that don't fit in an unsigned int. The import would succeed, but
"nix-store --verify-path" or subsequent exports would detect an
incorrect hash.

A deeper issue is that the export/import format does not contain a
hash, so we can't detect such issues early.

Also, I learned that -Wall does not warn about this.

(cherry picked from commit 41c4558afe)
2017-05-01 11:26:27 +02:00
Eelco Dolstra 5d59ec86d4
Bump version to 1.11.9 2017-04-25 16:58:00 +02:00
Eelco Dolstra 1ab5cc0f5a Merge pull request #1333 from copumpkin/fix-schema-version
Ensure that curSchema is set before opening the DB
2017-04-14 20:58:06 +02:00
Dan Peebles ad9e6037a4 Ensure that curSchema is set before opening the DB
Without this, it's possible to get `curSchema = 0` which then causes us
not to trigger the branch that maintains forward compatibility with the
1.12 schema.

Fixes #1332
2017-04-14 14:44:28 -04:00
Shea Levy eb6f3d5159 builtins.exec: Make the argument just a list
(cherry picked from commit 3ecb09a40a)
2017-03-31 11:58:51 -04:00
Shea Levy 967f231981 Add exec primop behind allow-unsafe-native-code-during-evaluation.
Execute a given program with the (optional) given arguments as the
user running the evaluation, parsing stdout as an expression to be
evaluated.

There are many use cases for nix that would benefit from being able to
run arbitrary code during evaluation, including but not limited to:

* Automatic git fetching to get a sha256 from a git revision
* git rev-parse HEAD
* Automatic extraction of information from build specifications from
  other tools, particularly language-specific package managers like
  cabal or npm
* Secrets decryption (e.g. with nixops)
* Private repository fetching

Ideally, we would add this functionality in a more principled way to
nix, but in the mean time 'builtins.exec' can be used to get these
tasks done.

The primop is only available when the
'allow-unsafe-native-code-during-evaluation' nix option is true. That
flag also enables the 'importNative' primop, which is strictly more
powerful but less convenient (since it requires compiling a plugin
against the running version of nix).

(cherry picked from commit 0bb8db257d)
2017-03-30 10:08:38 -04:00
Daiderd Jordan 773313591f
use std::tuple for ValueMap allocator
(cherry picked from commit 023217f07c)
2017-03-24 23:31:47 +01:00
Eelco Dolstra 206b61b074
useChroot -> useSandbox
(cherry picked from commit 8d7c6644c5)
2017-03-21 13:50:47 +01:00
Eelco Dolstra 201ad43d1a
Bump version to 1.11.8 2017-03-21 11:34:29 +01:00
Vladimír Čunát 9504bcf03c
nix-env: respect meta.outputsToInstall
Discussed on https://github.com/NixOS/nixpkgs/pull/12653#discussion_r51601849

(cherry picked from commit 03cbb9ad59)
2017-03-21 11:33:21 +01:00
Eelco Dolstra d8638ae6b4 Merge pull request #1259 from shlevy/1.11-netrc
Backport netrc-file option to 1.11
2017-03-20 17:37:54 +01:00
Shea Levy a437b8c5d2 download-from-binary-cache.pl: Respect netrc-file 2017-03-05 17:40:17 -05:00
Shea Levy 37bdb9d7f2 Backport netrc-file option to 1.11 2017-03-04 09:55:49 -05:00
Domen Kožar 13fe83dc8e
bail out if macOS 10.9 or lower is used during installer
(cherry picked from commit 48d4a23aa0)
Signed-off-by: Domen Kožar <domen@dev.si>

cc @edolstra
2017-02-23 15:12:35 +01:00
Eelco Dolstra 697b5755e4 Merge pull request #1247 from veprbl/ssl_fix2
use --cacert instead of --capath
2017-02-22 20:14:47 +01:00
Dmitry Kalinkin 06b46f646d
use --cacert instead of --capath
This forces curl to use nix bundled crt instead of picking one up from
system.

Fixes: 142c77711 ('Propagate path of CA bundle to curl child processes')
2017-02-22 14:04:47 -05:00
Eelco Dolstra 2936a8d1ca
Bump version 2017-02-22 12:43:54 +01:00
Eelco Dolstra 142c777112
Propagate path of CA bundle to curl child processes 2017-02-22 12:43:13 +01:00
Eelco Dolstra 41230dd463
SSL_CERT_FILE -> NIX_SSL_CERT_FILE
This prevents collisions with the "native" OpenSSL, in particular on
OS X.

Fixes #921.

(cherry picked from commit fb2dd32100)
2017-02-22 12:30:45 +01:00
Eelco Dolstra 8ca944e009
Add forward compatibility with the Nix 1.12 database schema 2017-02-22 12:19:42 +01:00
Eelco Dolstra 1fa2c86db5
Bump version to 1.11.6 2017-01-13 11:02:55 +01:00