diff --git a/src/borg/archiver/tar_cmds.py b/src/borg/archiver/tar_cmds.py index 2ee5a0712..c273ffde7 100644 --- a/src/borg/archiver/tar_cmds.py +++ b/src/borg/archiver/tar_cmds.py @@ -132,8 +132,8 @@ def item_to_tarinfo(item, original_path): tarinfo.name = item.path tarinfo.mtime = item.mtime / 1e9 tarinfo.mode = stat.S_IMODE(item.mode) - tarinfo.uid = item.uid - tarinfo.gid = item.gid + tarinfo.uid = item.get("uid", 0) + tarinfo.gid = item.get("gid", 0) tarinfo.uname = item.get("user", "") tarinfo.gname = item.get("group", "") # The linkname in tar has 2 uses: