Return a new :class:`SecurityDescriptor` from the ``SDDL``. :returns: :class:`SecurityDescriptor` .. warning:: At the moment the underliying buffer is never freed. See `ConvertStringSecurityDescriptorToSecurityDescriptorA <https://docs.microsoft.com/en-us/
(cls, sddl)
| 805 | # Constructors |
| 806 | @classmethod |
| 807 | def from_string(cls, sddl): |
| 808 | """Return a new :class:`SecurityDescriptor` from the ``SDDL``. |
| 809 | |
| 810 | :returns: :class:`SecurityDescriptor` |
| 811 | |
| 812 | .. warning:: |
| 813 | |
| 814 | At the moment the underliying buffer is never freed. |
| 815 | |
| 816 | See `ConvertStringSecurityDescriptorToSecurityDescriptorA <https://docs.microsoft.com/en-us/windows/desktop/api/sddl/nf-sddl-convertstringsecuritydescriptortosecuritydescriptora>`_ |
| 817 | """ |
| 818 | self = cls() |
| 819 | winproxy.ConvertStringSecurityDescriptorToSecurityDescriptorA( |
| 820 | sddl.encode("ascii"), |
| 821 | gdef.SDDL_REVISION_1, |
| 822 | self, |
| 823 | None) |
| 824 | # TODO: we need to free this buffer.. |
| 825 | # Keep track of Security Descritor state ? |
| 826 | return self |
| 827 | |
| 828 | @classmethod |
| 829 | def _from_name_and_type(cls, objname, objtype, flags=DEFAULT_SECURITY_INFORMATION, query_sacl=False): |
no outgoing calls
no test coverage detected