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

* 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).
This commit is contained in:
Eelco Dolstra 2007-01-29 15:51:37 +00:00
parent c558b1583c
commit b618fa6eb6
5 changed files with 18 additions and 6 deletions

View file

@ -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);
}