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/libstore/derivations.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstore/derivations.cc') diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index aea95ef31477..3456a5f714a0 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -29,7 +29,7 @@ Path writeDerivation(const Derivation & drv, const string & name) string suffix = name + drvExtension; string contents = atPrint(unparseDerivation(drv)); return readOnlyMode - ? computeStorePathForText(suffix, contents) + ? computeStorePathForText(suffix, contents, references) : store->addTextToStore(suffix, contents, references); } -- cgit 1.4.1