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

Comparison of substituter URI does not consider equivalence #2711

Open
dingxiangfei2009 opened this issue Mar 7, 2019 · 2 comments
Open
Labels

Comments

@dingxiangfei2009
Copy link
Contributor

dingxiangfei2009 commented Mar 7, 2019

Currently testing membership of a substituter URI in the set of substituters is by string comparison:

if (trusted.count(s))

This will break substituters that are listed as trusted with an equivalent URI.

Steps to reproduce the issue:

  1. On NixOS, or Nix with multi-user setup, export NIX_REMOTE=daemon from an untrusted user.
  2. Set ~/.config/nix/nix.conf to include substituters = https://cache.nixos.org. Notice the missing slash at the end of the URI
  3. nix-shell -p hello will warn about ignoring the substituter https://cache.nixos.org.

This issue can be reproduced with other substituter schema, such as ssh://<host>?<param1>&<param2>, ssh-ng://<host>?<param1>&<param2>, by specifying multiple parameters in the query string and permute them. Though the URIs are equivalent modulo the permutations, they are considered different.

@stale
Copy link

stale bot commented Feb 20, 2021

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

@stale stale bot added the stale label Feb 20, 2021
@stale
Copy link

stale bot commented Apr 28, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 28, 2022
@thufschmitt thufschmitt reopened this Feb 24, 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

2 participants