mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-22 06:01:54 +00:00
Verify archive metadata version before syncing cache.
This commit is contained in:
parent
bd5b72a646
commit
b41914aa8f
1 changed files with 2 additions and 0 deletions
|
@ -152,6 +152,8 @@ def add(id, size, csize):
|
|||
data = self.key.decrypt(id, cdata)
|
||||
add(id, len(data), len(cdata))
|
||||
archive = msgpack.unpackb(data)
|
||||
if archive[b'version'] != 1:
|
||||
raise Exception('Unknown archive metadata version')
|
||||
decode_dict(archive, (b'name', b'hostname', b'username', b'time')) # fixme: argv
|
||||
print('Analyzing archive:', archive[b'name'])
|
||||
for id_, chunk in zip_longest(archive[b'items'], self.repository.get_many(archive[b'items'])):
|
||||
|
|
Loading…
Reference in a new issue