Browse Source

export-tar: for items w/o uid/gid, default to 0/0, see #7249

Thomas Waldmann 2 năm trước cách đây
mục cha
commit
18898d68f0
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/borg/archiver/tar_cmds.py

+ 2 - 2
src/borg/archiver/tar_cmds.py

@@ -132,8 +132,8 @@ class TarMixIn:
             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: