From: Joseph Sutton Date: Fri, 25 Aug 2023 03:12:39 +0000 (+1200) Subject: tests/krb5: Add KerberosCredentials.get_rid() X-Git-Tag: tevent-0.16.0~757 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4a2e64110f9c1fb159bc6c8cc94cd90ba14323e;p=thirdparty%2Fsamba.git tests/krb5: Add KerberosCredentials.get_rid() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index f2b8e1e58bf..8d578bb0b89 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -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