-
-
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
Fix restricted mode when installing in non-canonical data dir #1815
Conversation
Ping |
Why does it matter whether the install location is non-canonical? (What's the canonical location anyway?) |
Canonical as-in |
It matters because NIX_PATH lookup canonicalizes the path first, so it's disallowed in restricted mode. |
I think there's a similar problem when |
This is related, yeah. |
@edolstra ping |
src/libexpr/eval.cc
Outdated
@@ -311,7 +311,7 @@ EvalState::EvalState(const Strings & _searchPath, ref<Store> store) | |||
addToSearchPath("nix=" + settings.nixDataDir + "/nix/corepkgs"); | |||
|
|||
if (settings.restrictEval || settings.pureEval) { | |||
allowedPaths = PathSet(); | |||
allowedPaths = {canonPath(settings.nixDataDir + "/nix/corepkgs", true)}; |
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.
Isn't the correct fix to do
addToSearchPath("nix=" + canonPath(settings.nixDataDir + "/nix/corepkgs"));
?
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.
Sure, I'll switch to that.
1970179
to
ddbcd01
Compare
@edolstra Fixed |
No description provided.