diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-12-04 22:17:19 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-12-04 22:17:19 -0600 |
commit | b9a00fd15bb158c293b40aec49c9a426cc4c8921 (patch) | |
tree | 46d4e2ec023bc022f1735ba7a5c4775dd0aba136 | |
parent | 6ed09cb8c2c27f30bec1eccb153db80dc5a77520 (diff) |
Canonicalize binary caches with ‘/’ when one is missing
This checks if there is a trusted substituter with a slash, so
trusting https://cache.nixos.org also implies https://cache.nixos.org/
is trusted.
-rw-r--r-- | src/libstore/daemon.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index e5cfe94cb..2224d54d5 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -215,6 +215,8 @@ struct ClientSettings for (auto & s : ss) if (trusted.count(s)) subs.push_back(s); + else if (!hasSuffix(s, "/") && trusted.count(s + "/")) + subs.push_back(s + "/"); else warn("ignoring untrusted substituter '%s'", s); res = subs; |