From 506c01dc8fc5b596e19b574201b386a02e3074c2 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 17 Jun 2021 15:59:41 +0200 Subject: [PATCH] import-tar: fix empty user/group name in TarInfo, fixes #5853 if the tar has no information about user/group name (empty string), we must assign None to Item.user/group (not the empty string). --- src/borg/archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/archive.py b/src/borg/archive.py index 2de2e90e9..aca04c0b9 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -1410,7 +1410,7 @@ class TarfileObjectProcessors: @contextmanager def create_helper(self, tarinfo, status=None, type=None): item = Item(path=make_path_safe(tarinfo.name), mode=tarinfo.mode | type, - uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname, group=tarinfo.gname, + uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname or None, group=tarinfo.gname or None, mtime=tarinfo.mtime * 1000**3) yield item, status # if we get here, "with"-block worked ok without error/exception, the item was processed ok...