Browse Source

Fix missing Item.win_dacl

Marian Beermann 9 years ago
parent
commit
1284459ee3
2 changed files with 3 additions and 3 deletions
  1. 1 0
      src/borg/item.py
  2. 2 3
      src/borg/platform/windows.pyx

+ 1 - 0
src/borg/item.py

@@ -134,6 +134,7 @@ class Item(PropDict):
     acl_default = PropDict._make_property('acl_default', bytes)
     acl_extended = PropDict._make_property('acl_extended', bytes)
     acl_nfs4 = PropDict._make_property('acl_nfs4', bytes)
+    win_dacl = PropDict._make_property('win_dacl', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
 
     mode = PropDict._make_property('mode', int)
     uid = PropDict._make_property('uid', int)

+ 2 - 3
src/borg/platform/windows.pyx

@@ -8,7 +8,6 @@ cimport cpython.array
 import array
 
 import platform
-from ..helpers import safe_decode, safe_encode
 
 API_VERSION = 3
 
@@ -300,7 +299,7 @@ def acl_get(path, item, st, numeric_owner=False):
             continue
         permissions = {'user': {'name': name, 'sid': sidstr}, 'permissions': (ACEs[i].grfAccessPermissions, ACEs[i].grfAccessMode, ACEs[i].grfInheritance)}
         pyDACL.append(permissions)
-    item['win_dacl'] = safe_encode(json.dumps(pyDACL))
+    item['win_dacl'] = json.dumps(pyDACL)
 
     free(SD)
     LocalFree(<HLOCAL>ACEs)
@@ -310,7 +309,7 @@ def acl_set(path, item, numeric_owner=False):
     if 'win_dacl' not in item:
         return
 
-    pyDACL = json.loads(safe_decode(item['win_dacl']))
+    pyDACL = json.loads(item.win_dacl)
     cdef _EXPLICIT_ACCESS_W* ACEs = <_EXPLICIT_ACCESS_W*>calloc(sizeof(_EXPLICIT_ACCESS_W), len(pyDACL))
     cdef wchar_t* temp
     cdef PSID newsid