Adapted some stuff in security.py for py3

This commit is contained in:
hakril
2020-02-13 23:17:43 +01:00
parent fe22a5ad0d
commit 9f69b1cefa
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -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
View File
@@ -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