diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-03-09T14·32+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-03-09T14·32+0000 |
commit | 4c356acd044dffbf459ac895b483b49959042931 (patch) | |
tree | f5a9d5ee7f9092a860e28415287de0cb0ac37cf4 /src/libutil | |
parent | 44f6e6de77dd318800775d594b1f33cffa2be9a5 (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')
-rw-r--r-- | src/libutil/hash.cc | 7 | ||||
-rw-r--r-- | src/libutil/hash.hh | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index eef01fe4d609..bd7e33a48e70 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; diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 062d97254bfc..81425b23494c 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -96,6 +96,7 @@ private: public: HashSink(HashType ht); + HashSink(const HashSink & h); ~HashSink(); virtual void operator () (const unsigned char * data, unsigned int len); Hash finish(); @@ -104,5 +105,5 @@ public: } - + #endif /* !__HASH_H */ |