aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/daemon.cc
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-12-04 22:17:19 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2020-12-04 22:17:19 -0600
commitb9a00fd15bb158c293b40aec49c9a426cc4c8921 (patch)
tree46d4e2ec023bc022f1735ba7a5c4775dd0aba136 /src/libstore/daemon.cc
parent6ed09cb8c2c27f30bec1eccb153db80dc5a77520 (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.
Diffstat (limited to 'src/libstore/daemon.cc')
-rw-r--r--src/libstore/daemon.cc2
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;