about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-01-29T15·51+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-01-29T15·51+0000
commitb618fa6eb6aa4cc128286ab748bfb100fa46a888 (patch)
treecbc903a32f4b1fa2570904e4e4768839b2e64a1e /src/libexpr/primops.cc
parentc558b1583c0e23bf4e19e916ef0ba223b61405a3 (diff)
* 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).

Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc2
1 files changed, 1 insertions, 1 deletions
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