1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-26 07:53:58 +00:00

Merge pull request #7052 from ThomasWaldmann/fix-upgrader-user-group-none

transfer: fix user/group == None crash with borg1 archives
This commit is contained in:
TW 2022-09-28 14:35:40 +02:00 committed by GitHub
commit f2fe22522d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,6 +365,10 @@ class Item(PropDict):
# also need to fix old timestamp data types. # also need to fix old timestamp data types.
for k, v in list(d.items()): for k, v in list(d.items()):
k = fix_key(d, k) k = fix_key(d, k)
if k in ('user', 'group') and d[k] is None:
# borg 1 stored some "not known" values with a None value.
# borg 2 policy for such cases is to just not have the key/value pair.
continue
if k in ('path', 'source', 'user', 'group'): if k in ('path', 'source', 'user', 'group'):
v = fix_str_value(d, k) v = fix_str_value(d, k)
if k in ('chunks', 'chunks_healthy'): if k in ('chunks', 'chunks_healthy'):