(x)
| 806 | |
| 807 | @staticmethod |
| 808 | def fromstr(x): |
| 809 | m = WINNT_SID._SID_REG.match(x) |
| 810 | if not m: |
| 811 | raise ValueError("Invalid SID format !") |
| 812 | rev, authority, subauthority = m.groups() |
| 813 | return WINNT_SID( |
| 814 | Revision=int(rev), |
| 815 | IdentifierAuthority=WINNT_SID_IDENTIFIER_AUTHORITY( |
| 816 | Value=struct.pack(">Q", int(authority))[2:] |
| 817 | ), |
| 818 | SubAuthority=[int(x) for x in subauthority[1:].split("-")], |
| 819 | ) |
| 820 | |
| 821 | def summary(self): |
| 822 | return "S-%s-%s%s" % ( |
no test coverage detected