From b618fa6eb6aa4cc128286ab748bfb100fa46a888 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 29 Jan 2007 15:51:37 +0000 Subject: * computeStorePathForText: take the references into account when computing the store path (NIX-77). This is an important security property in multi-user Nix stores. Note that this changes the store paths of derivations (since the derivation aterms are added using addTextToStore), but not most outputs (unless they use builtins.toFile). --- src/libexpr/primops.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 589faf48ae25..aca5f5856de8 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -624,7 +624,7 @@ static Expr prim_toFile(EvalState & state, const ATermVector & args) } Path storePath = readOnlyMode - ? computeStorePathForText(name, contents) + ? computeStorePathForText(name, contents, refs) : store->addTextToStore(name, contents, refs); /* Note: we don't need to add `context' to the context of the -- cgit 1.4.1