-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make incremental update of uncompressed index.tar more robust
The current code blindly assumes that the pre-existing index.tar is a prefix to the new uncompressed index.tar; Besides the possibility of data corruption, the incremental index.tar.gz update logic however supports update transactions which can violate this assumption, resulting in a state where the index.tar doesn't get updated or alternative gets corrupted for real. This patch makes the incremental update of the uncompressed index.tar more robust by verifying that the prefix of the old index.tar is in fact contained in the new index.tar data stream it is to be updated with. If this validation fails, the code falls back to the (slower) non-incremental full decompression codepath. This guarantees that the uncompressed index.tar will be consistent with the compressed index.tar.gz. This fixes #196.
- Loading branch information
Showing
1 changed file
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters