Skip to content
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

allowed-uris doesn't work with builtins.readFile/builtins.readDir #2596

Open
infinisil opened this issue Dec 21, 2018 · 6 comments
Open

allowed-uris doesn't work with builtins.readFile/builtins.readDir #2596

infinisil opened this issue Dec 21, 2018 · 6 comments
Labels

Comments

@infinisil
Copy link
Member

infinisil commented Dec 21, 2018

This doesn't work:

$ nix eval "(builtins.readFile $PWD/a)" \
  --option restrict-eval true \
  --option allowed-uris "file://$PWD/a"
error: access to path '/home/infinisil/Test/restricted/a' is forbidden in restricted mode

But I'd expect it to work. I currently need to use builtins.fetchurl instead.

This differs in behavior to the -I option, which works just fine with builtins.readFile:

$ nix eval '(builtins.readFile <pwd/a>)' \
  --option restrict-eval true -
  -I pwd=$PWD
"a\n"
@stale
Copy link

stale bot commented Feb 21, 2021

I marked this as stale due to inactivity. → More info

1 similar comment
@stale
Copy link

stale bot commented Aug 22, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Aug 22, 2021
@infinisil
Copy link
Member Author

I still think this should be fixed

@stale stale bot removed the stale label Nov 30, 2021
@stale
Copy link

stale bot commented Jul 11, 2022

I marked this as stale due to inactivity. → More info

@infinisil
Copy link
Member Author

.

@stale stale bot added the stale label Jul 11, 2022
@infinisil
Copy link
Member Author

Still relevant!

@stale stale bot removed the stale label Jul 11, 2022
@stale stale bot added the stale label Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant