浏览代码

on linux, symlinks can't have ACLs, see #4044

(cherry picked from commit ca1928c92596d18fd240db604315680145265c43)
Thomas Waldmann 6 年之前
父节点
当前提交
ca6a7d1500
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/borg/platform/linux.pyx

+ 4 - 0
src/borg/platform/linux.pyx

@@ -273,6 +273,10 @@ def acl_set(path, item, numeric_owner=False, fd=None):
     cdef acl_t access_acl = NULL
     cdef acl_t default_acl = NULL
 
+    if stat.S_ISLNK(item.get('mode', 0)):
+        # Linux does not support setting ACLs on symlinks
+        return
+
     if fd is None and isinstance(path, str):
         path = os.fsencode(path)
     if numeric_owner: