backup: verify if archive chunks are not reordered
Now, when file name is also integrity protected (prefixed to the passphrase), we can make sure that input files are given in the same order. And are parts of the same VM. QubesOS/qubes-issues#971
This commit is contained in:
parent
4ad15c082b
commit
51b66208f3
@ -1303,7 +1303,19 @@ class ExtractWorker3(ExtractWorker2):
|
||||
os.remove(filename)
|
||||
continue
|
||||
else:
|
||||
(basename, ext) = os.path.splitext(self.tar2_current_file)
|
||||
previous_chunk_number = int(ext[1:])
|
||||
expected_filename = basename + '.%03d' % (
|
||||
previous_chunk_number+1)
|
||||
if expected_filename != filename:
|
||||
self.cleanup_tar2(wait=True, terminate=True)
|
||||
self.log.error(
|
||||
'Unexpected file in archive: {}, expected {}'.format(
|
||||
filename, expected_filename))
|
||||
os.remove(filename)
|
||||
continue
|
||||
self.log.debug("Releasing next chunck")
|
||||
|
||||
self.tar2_current_file = filename
|
||||
|
||||
run_error = handle_streams(
|
||||
|
Loading…
Reference in New Issue
Block a user