]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Add KerberosCredentials.get_rid()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 25 Aug 2023 03:12:39 +0000 (15:12 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 30 Aug 2023 02:15:29 +0000 (02:15 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/krb5/raw_testcase.py

index f2b8e1e58bf2139389f84eabfa6649b6b2e43881..8d578bb0b899775ebeaa0f94acec306ed1e1be32 100644 (file)
@@ -551,6 +551,14 @@ class KerberosCredentials(Credentials):
     def get_sid(self):
         return self.sid
 
+    def get_rid(self):
+        sid = self.get_sid()
+        if sid is None:
+            return None
+
+        _, rid = sid.rsplit('-', 1)
+        return int(rid)
+
     def set_type(self, account_type):
         self.account_type = account_type