1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

Refactoring: Add allowPath() method

This commit is contained in:
Eelco Dolstra 2021-10-07 12:11:00 +02:00
parent c9ee634f75
commit cfaad7168e
7 changed files with 21 additions and 17 deletions

View file

@ -169,8 +169,7 @@ static void fetchTree(
auto [tree, input2] = input.fetch(state.store);
if (state.allowedPaths)
state.allowedPaths->insert(tree.actualPath);
state.allowPath(tree.actualPath);
emitTreeAttrs(state, tree, input2, v, params.emptyRevFallback, false);
}
@ -245,8 +244,7 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
*url, expectedHash->to_string(Base32, true), hash.to_string(Base32, true));
}
if (state.allowedPaths)
state.allowedPaths->insert(realPath);
state.allowPath(realPath);
auto path = state.store->printStorePath(storePath);
mkString(v, path, PathSet({path}));