mirror of https://github.com/borgbackup/borg.git
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).
This commit is contained in:
parent
4b9e99308c
commit
506c01dc8f
|
@ -1410,7 +1410,7 @@ class TarfileObjectProcessors:
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def create_helper(self, tarinfo, status=None, type=None):
|
def create_helper(self, tarinfo, status=None, type=None):
|
||||||
item = Item(path=make_path_safe(tarinfo.name), mode=tarinfo.mode | type,
|
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)
|
mtime=tarinfo.mtime * 1000**3)
|
||||||
yield item, status
|
yield item, status
|
||||||
# if we get here, "with"-block worked ok without error/exception, the item was processed ok...
|
# if we get here, "with"-block worked ok without error/exception, the item was processed ok...
|
||||||
|
|
Loading…
Reference in New Issue