mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Adapted some stuff in security.py for py3
This commit is contained in:
@@ -28,6 +28,12 @@ def test_empty_security_descriptor():
|
||||
assert esd.dacl is None
|
||||
assert esd.sacl is None
|
||||
|
||||
def test_security_descriptor__str__():
|
||||
sddl = "D:(A;;FA;;;WD)"
|
||||
sd = SecurityDescriptor.from_string(sddl)
|
||||
assert str(sd) == sddl
|
||||
|
||||
|
||||
|
||||
def test_pacl_object():
|
||||
SDDL = "O:ANG:S-1-2-3D:(A;;;;;S-1-42-42)(A;;;;;S-1-42-43)(A;;;;;S-1-42-44)"
|
||||
|
||||
+2
-2
@@ -927,7 +927,7 @@ class SecurityDescriptor(gdef.PSECURITY_DESCRIPTOR):
|
||||
None)
|
||||
result = result_cstr.value # Retrieve a python-str copy
|
||||
winproxy.LocalFree(result_cstr)
|
||||
return result
|
||||
return result.decode()
|
||||
|
||||
__str__ = to_string
|
||||
|
||||
@@ -1056,7 +1056,7 @@ def explain_acl(acl, sdtype=None):
|
||||
if acl is None:
|
||||
yield u"None"
|
||||
for ace in acl.aces:
|
||||
yield unicode(ace)
|
||||
yield str(ace)
|
||||
for line in ACE_EXPLAINER[ace.Header.AceType](ace, sdtype):
|
||||
yield u" " + line
|
||||
|
||||
|
||||
Reference in New Issue
Block a user