mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Add option allowed-uris
This allows network access in restricted eval mode.
This commit is contained in:
parent
f1c555cef8
commit
812e027e1d
8 changed files with 67 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue