mirror of
https://github.com/NixOS/nix
synced 2025-07-02 01:01:48 +02:00
* 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).
This commit is contained in:
parent
44f6e6de77
commit
4c356acd04
3 changed files with 26 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue