aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/fetchgit.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/primops/fetchgit.cc b/src/libexpr/primops/fetchgit.cc
index 38bffd8db..81b641900 100644
--- a/src/libexpr/primops/fetchgit.cc
+++ b/src/libexpr/primops/fetchgit.cc
@@ -113,9 +113,6 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
- // FIXME: cut&paste from fetch().
- if (state.restricted) throw Error("'fetchGit' is not allowed in restricted mode");
-
std::string url;
std::string ref = "master";
std::string rev;
@@ -150,6 +147,10 @@ static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Va
} else
url = state.forceStringNoCtx(*args[0], pos);
+ // FIXME: git externals probably can be used to bypass the URI
+ // whitelist. Ah well.
+ state.checkURI(url);
+
auto gitInfo = exportGit(state.store, url, ref, rev, name);
state.mkAttrs(v, 8);