Commit Graph

16196 Commits

Author SHA1 Message Date
pennae
631b2de30f fix debugger crashing while printing envs
fixes #9932

(cherry picked from commit 5ccb06ee1b)
2024-03-11 08:28:17 +01:00
Eelco Dolstra
fea2043060 GitHub fetcher: Ignore treeHash attribute for forward compatibility
See https://github.com/NixOS/nix/pull/10197.
2024-03-08 16:02:01 +01:00
Eelco Dolstra
02069f3058 Bump version 2024-03-07 16:49:52 +01:00
Eelco Dolstra
f8170ce9f1
Merge pull request from GHSA-2ffj-w4mj-pg37
Sandbox escape 2.20
2024-03-07 11:56:24 +01:00
Théophane Hufschmitt
d6918898c9 Add release notes 2024-03-07 09:38:54 +01:00
Théophane Hufschmitt
244f3eee0b Copy the output of fixed-output derivations before registering them
It is possible to exfiltrate a file descriptor out of the build sandbox
of FODs, and use it to modify the store path after it has been
registered.
To avoid that issue, don't register the output of the build, but a copy
of it (that will be free of any leaked file descriptor).
2024-03-07 09:38:51 +01:00
Théophane Hufschmitt
4645652975 Add a NixOS test for the sandbox escape
Test that we can't leverage abstract unix domain sockets to leak file
descriptors out of the sandbox and modify the path after it has been
registered.
2024-03-07 09:38:24 +01:00
Théophane Hufschmitt
584d64bebc
Merge pull request #10154 from intelfx/work/fix-null-deref
libfetchers/git: fix UB due to invalid usage of unique_ptr
2024-03-05 09:10:28 +01:00
Ivan Shapovalov
651e62781f libfetchers/git: use unique_ptr::get() instead of operator*()
According to N4950 20.3.1.3.5 [unique.ptr.single.observers]/1,
the behavior is undefined if get() == nullptr. Use get() instead of
operator*() on a possibly-null unique_ptr.

Fixes #10123.
2024-03-05 03:50:26 +01:00
Théophane Hufschmitt
82d7d740c9
Merge pull request #10142 from NixOS/backport-10073-to-2.20-maintenance
[Backport 2.20-maintenance] Accept multiple inputs in `nix flake update`
2024-03-04 10:31:19 +01:00
Olmo Kramer
b005d736ef Add test for nix flake update with multiple inputs
(cherry picked from commit b1ad729add)
2024-03-04 08:54:00 +00:00
Olmo Kramer
31c908a9e2 Accept multiple inputs in nix flake update
(cherry picked from commit 9f11b1b0c4)
2024-03-04 08:54:00 +00:00
Eelco Dolstra
b636f1ecd8 Bump version 2024-02-28 20:23:14 +01:00
Robert Hensing
edcb3430ef
Merge pull request #10102 from NixOS/backport-10044-to-2.20-maintenance
[Backport 2.20-maintenance] Handle empty Git repositories / workdirs
2024-02-28 03:00:35 +01:00
Eelco Dolstra
15c0a7b2ce Support empty Git repositories / workdirs
Fixes #10039.

(cherry picked from commit 9e762454cf)
2024-02-28 01:40:43 +00:00
Eelco Dolstra
2e78ef5612 AllowListInputAccessor: Clarify that the "allowed paths" are actually allowed prefixes
E.g. adding "/" will allow access to the root and *everything below it*.

(cherry picked from commit d52d91fe7a)
2024-02-28 01:40:43 +00:00
Eelco Dolstra
7599d4bbed Bump version 2024-02-21 16:22:16 +01:00
Eelco Dolstra
8a8172cd2b
Merge pull request #10050 from NixOS/backport-10049-to-2.20-maintenance
[Backport 2.20-maintenance] Don't send settings that depend on disabled experimental features to the daemon
2024-02-21 13:05:51 +01:00
Eelco Dolstra
7b45cc30a1
Merge pull request #10057 from NixOS/backport-10055-to-2.20-maintenance
[Backport 2.20-maintenance] Faster flake.lock parsing
2024-02-21 12:20:21 +01:00
Graham Dennis
e52d384766 Faster flake.lock parsing
This PR reduces the creation of short-lived basic_json objects while
parsing flake.lock files. For large flake.lock files (~1.5MB) I was
observing ~60s being spent for trivial nix build operations while
after this change it is now taking ~1.6s.

(cherry picked from commit 7fd0de38c6)
2024-02-21 11:19:23 +00:00
Eelco Dolstra
0b32c8763b Don't send settings that depend on disabled experimental features to the daemon
This fixes warnings like

   warning: Ignoring setting 'auto-allocate-uids' because experimental feature 'auto-allocate-uids' is not enabled
   warning: Ignoring setting 'impure-env' because experimental feature 'configurable-impure-env' is not enabled

when using the daemon and the user didn't actually set those settings.

Note: this also hides those settings from `nix config show`, but that
seems a good thing.

(cherry picked from commit 0acd783190)
2024-02-20 14:53:28 +00:00
Eelco Dolstra
adb1d56862
Merge pull request #10045 from NixOS/backport-10043-to-2.20-maintenance
[Backport 2.20-maintenance] fetchToStore(): Don't always respect settings.readOnlyMode
2024-02-20 12:50:30 +01:00
Eelco Dolstra
28dd392948 fetchToStore(): Don't always respect settings.readOnlyMode
It's now up to the caller whether readOnlyMode should be applied. In
some contexts (like InputScheme::fetch()), we always need to fetch.

(cherry picked from commit 7cb4d0c5b7)
2024-02-20 11:08:06 +00:00
Eelco Dolstra
7f02d17881 Don't say "copying X to the store" in read-only mode
(cherry picked from commit 6162105675)
2024-02-20 11:08:06 +00:00
Eelco Dolstra
ce23ef4a77 Bump version 2024-02-19 15:37:26 +01:00
Robert Hensing
98c22e8798
Merge pull request #10023 from NixOS/backport-9985-to-2.20-maintenance
[Backport 2.20-maintenance] Restore `builtins.pathExists` behavior on broken symlinks
2024-02-16 22:55:21 +01:00
John Ericson
02f7025deb Add note about this being a temp solution
(cherry picked from commit e27b7e04bf)
2024-02-16 14:24:23 +00:00
Alois Wohlschlager
0571e6e9b4 Restore builtins.pathExists behavior on broken symlinks
Commit 83c067c0fa changed `builtins.pathExists`
to resolve symlinks before checking for existence. Consequently, if the path
refers to a symlink itself, existence of the target of the symlink (instead of
the symlink itself) was checked. Restore the previous behavior by skipping
symlink resolution in the last component.

(cherry picked from commit 89e21ab4bd)
2024-02-16 14:24:23 +00:00
Eelco Dolstra
982d07d009
Merge pull request #10011 from NixOS/backport-10006-to-2.20-maintenance
[Backport 2.20-maintenance] <nix/fetchurl.nix>: Restore support for "impure = true"
2024-02-13 23:03:59 +01:00
Eelco Dolstra
7f66d4f167 <nix/fetchurl.nix>: Restore support for "impure = true"
(cherry picked from commit bb63bd50e6)
2024-02-13 21:51:13 +00:00
Eelco Dolstra
52e53a2983
Merge pull request #9991 from NixOS/backport-9976-to-2.20-maintenance
[Backport 2.20-maintenance] Restore manual pages
2024-02-12 15:31:57 +01:00
Alois Wohlschlager
c5a8b9050c Restore manual pages
Commit d536c57e87 inadvertedly broke build and
installation of all non-autogenerated manual pages (in particular, all the ones
documenting the stable CLI), by moving the definition of the man-pages variable
in doc/manual/local.mk after its usage in mk/lib.mk. Move including the former
earlier so that the correct order is restored.

(cherry picked from commit 8f3253c6f4)
2024-02-12 14:22:06 +00:00
Eelco Dolstra
86dfeebb3d
Merge pull request #9958 from NixOS/backport-9949-to-2.20-maintenance
[Backport 2.20-maintenance] fix location of `_redirects` file
2024-02-07 15:26:07 +01:00
Valentin Gagarin
8f14bf4712 fix location of _redirects file
the Netlify `_redirects` file must be in the root directory [0] of the
files to serve, and mdBook copies all the files in `src` that aren't
`.md` to the output directory [1].

[0]: https://docs.netlify.com/routing/redirects/
[1]: https://rust-lang.github.io/mdBook/guide/creating.html#source-files

(cherry picked from commit 2d74b56aee)
2024-02-07 10:35:09 +00:00
Théophane Hufschmitt
10e1579c81
Merge pull request #9910 from NixOS/backport-9902-to-2.20-maintenance
[Backport 2.20-maintenance] builtin:fetchurl: Ensure a fixed-output derivation
2024-02-02 14:13:01 +01:00
Eelco Dolstra
b6bf4a80d8 Better test fix
(cherry picked from commit e67458e5b8)
2024-02-02 13:00:54 +00:00
Eelco Dolstra
955be03476 Fix test
(cherry picked from commit 05535be03a)
2024-02-02 13:00:54 +00:00
Eelco Dolstra
aab4a17258 builtin:fetchurl: Get output hash info from the drv
(cherry picked from commit b8b739e484)
2024-02-02 13:00:54 +00:00
Eelco Dolstra
df2156a5d2 builtin:fetchurl: Ensure a fixed-output derivation
Previously we didn't check that the derivation was fixed-output, so
you could use builtin:fetchurl to impurely fetch a file.

(cherry picked from commit 1ee42c5b88)
2024-02-02 13:00:54 +00:00
John Ericson
db82034fee
Merge pull request #9891 from NixOS/backport-9867-to-2.20-maintenance
[Backport 2.20-maintenance] #912 allow leading period
2024-01-31 15:36:03 -05:00
Robert Hensing
b5947b55e2 Disallow store path names that are . or .. (plus opt. -)
As discussed in the maintainer meeting on 2024-01-29.

Mainly this is to avoid a situation where the name is parsed and
treated as a file name, mostly to protect users.
.-* and ..-* are also considered invalid because they might strip
on that separator to remove versions. Doesn't really work, but that's
what we decided, and I won't argue with it, because .-* probably
doesn't seem to have a real world application anyway.
We do still permit a 1-character name that's just "-", which still
poses a similar risk in such a situation. We can't start disallowing
trailing -, because a non-zero number of users will need it and we've
seen how annoying and painful such a change is.

What matters most is preventing a situation where . or .. can be
injected, and to just get this done.

(cherry picked from commit f1b4663805)
2024-01-31 18:11:17 +00:00
Robert Hensing
60fb31a87d test: Generate distinct hashes
Gen::just is the constant generator. Don't just return that!
(cherry picked from commit 8406da2877)
2024-01-31 18:11:17 +00:00
Robert Hensing
b35958bd7c test: Generate distinct path names
Gen::just is the constant generator. Don't just return that!
(cherry picked from commit 69bbd5852a)
2024-01-31 18:11:17 +00:00
Robert Hensing
f36832ce13 parseStorePath: Support leading period
(cherry picked from commit b13e6a76b4)
2024-01-31 18:11:17 +00:00
Robert Hensing
0f4db25957 Revert "StorePath: reject names starting with '.'"
This reverts commit 24bda0c7b3.

(cherry picked from commit 9ddd0f2af8)
2024-01-31 18:11:17 +00:00
Eelco Dolstra
8f42912c80 Bump version 2024-01-30 18:58:56 +01:00
Eelco Dolstra
a4a4ef9b53
Merge pull request #9886 from NixOS/backport-9884-to-2.20-maintenance
[Backport 2.20-maintenance] Resolve symlinks in a few more places
2024-01-30 17:10:35 +01:00
Eelco Dolstra
5ad5b4447c Resolve symlinks in a few more places
Fixes #9882.

(cherry picked from commit b36ff47e7c)
2024-01-30 16:10:21 +00:00
Eelco Dolstra
1b2b240f22 Bump version 2024-01-29 22:56:56 +01:00
Eelco Dolstra
16e1ff3bcb Mark as stable 2024-01-29 18:59:20 +01:00