aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-03-09 14:32:03 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-03-09 14:32:03 +0000
commit4c356acd044dffbf459ac895b483b49959042931 (patch)
treef5a9d5ee7f9092a860e28415287de0cb0ac37cf4 /src/libutil/hash.cc
parent44f6e6de77dd318800775d594b1f33cffa2be9a5 (diff)
* In `nix-store --export', abort if the contents of a path has
changed. This prevents corrupt paths from spreading to other machines. Note that checking the hash is cheap because we're hashing anyway (because of the --sign feature).
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index eef01fe4d..bd7e33a48 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -289,6 +289,13 @@ HashSink::HashSink(HashType ht) : ht(ht)
start(ht, *ctx);
}
+HashSink::HashSink(const HashSink & h)
+{
+ ht = h.ht;
+ ctx = new Ctx;
+ *ctx = *h.ctx;
+}
+
HashSink::~HashSink()
{
delete ctx;