-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move restricted/pure-eval access control out of the evaluator and into the accessor #9497
Conversation
Didn't read all the code while it is still draft, but the concept is quite nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symlinks strike again.
Otherwise looks like the right direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a regression with symlinks. Needs a test case.
Currently:
ls -l tunnel.d/
total 4
lrwxrwxrwx 1 user user 2 Nov 30 23:46 tunnel -> ..
$ ./result/bin/nix-instantiate --restrict-eval --eval -E 'let __nixPath = [ { prefix = "foo"; path = ./tunnel.d; } ]; in builtins.readFile <foo/tunnel/aliens-truth>' -I tunnel.d
"They're among us.\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some tests and PosixSourceAccessor
now aggressively checks against symlinks.
All path components must not be symlinks now (so the user needs to call `resolveSymlinks()` when needed).
Since we're doing a lot of them in assertNoSymlinks().
Co-authored-by: Robert Hensing <[email protected]>
This caused a regression: #9901 |
Because it broke colmena, zhaofengli/colmena#190 Ref: - NixOS/nix#9497 - NixOS/nix#9901 - NixOS/nix#9985
on newer nix versions (> 2.18) the "path:" settings will lead to evaluation errors when the flake uses symbolic links. a typical error message would be: `error: access to absolute path '/lib' is forbidden in pure evaluation mode (use '--impure' to override)` when `/lib` actually is `./lib`. When "path:" is replaced by just using the flake's path no evaluation error is shown. As per the man page of `nix flake` the "path" attribute reffers to the local path of the flake. This can just be removed (AFAIK) by referencing to the path as a positional argument. Possible related issues: NixOS/nix#11030 original PR introducing the error message NixOS/nix#9497 Signed-off-by: Florian Brandes <[email protected]>
Because it broke colmena, zhaofengli/colmena#190 Ref: - NixOS/nix#9497 - NixOS/nix#9901 - NixOS/nix#9985
Motivation
Extracted from lazy-trees.
Context
Priorities
Add 👍 to pull requests you find important.