瀏覽代碼

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

Thomas Waldmann 6 年之前
父節點
當前提交
ca1928c925
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/borg/platform/linux.pyx

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

@@ -200,6 +200,10 @@ def acl_set(path, item, numeric_owner=False):
     cdef acl_t access_acl = NULL
     cdef acl_t access_acl = NULL
     cdef acl_t default_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
+
     p = <bytes>os.fsencode(path)
     p = <bytes>os.fsencode(path)
     if numeric_owner:
     if numeric_owner:
         converter = posix_acl_use_stored_uid_gid
         converter = posix_acl_use_stored_uid_gid