1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

python: move HRES_SEC_* constants to samba module

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Rob van der Linde
2023-11-28 15:13:21 +13:00
committed by Andrew Bartlett
parent 1a45e49b5f
commit b14ead30da
5 changed files with 7 additions and 11 deletions

View File

@ -398,3 +398,6 @@ NTSTATUSError = _glue.NTSTATUSError
HRESULTError = _glue.HRESULTError
WERRORError = _glue.WERRORError
DsExtendedError = _glue.DsExtendedError
HRES_SEC_E_LOGON_DENIED = 0x8009030C
HRES_SEC_E_INVALID_TOKEN = 0x80090308

View File

@ -38,6 +38,7 @@ from samba.netcmd.domain.models import AuthenticationPolicy, AuthenticationSilo
import samba.tests
import samba.tests.krb5.kcrypto as kcrypto
from samba import HRES_SEC_E_INVALID_TOKEN, HRES_SEC_E_LOGON_DENIED
from samba.tests.krb5.kdc_base_test import GroupType
from samba.tests.krb5.kdc_tgs_tests import KdcTgsBaseTests
from samba.tests.auth_log_base import AuthLogTestBase, NoMessageException
@ -59,9 +60,6 @@ SidType = RawKerberosTest.SidType
global_asn1_print = False
global_hexdump = False
HRES_SEC_E_INVALID_TOKEN = 0x80090308
HRES_SEC_E_LOGON_DENIED = 0x8009030C
AUTHN_VERSION = {'major': 1, 'minor': 3}
AUTHZ_VERSION = {'major': 1, 'minor': 2}

View File

@ -26,7 +26,7 @@ from functools import partial
import ldb
from samba import generate_random_password, ntstatus
from samba import generate_random_password, ntstatus, HRES_SEC_E_LOGON_DENIED
from samba.dcerpc import netlogon, security
import samba.tests.krb5.kcrypto as kcrypto
@ -51,8 +51,6 @@ import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
global_asn1_print = False
global_hexdump = False
HRES_SEC_E_LOGON_DENIED = 0x8009030C
class ProtectedUsersTests(KDCBaseTest):
def setUp(self):

View File

@ -21,6 +21,7 @@ from samba.tests.password_test import PasswordTestCase
import samba.getopt as options
from samba import HRES_SEC_E_INVALID_TOKEN
from samba.auth import system_session
from samba.credentials import Credentials
from samba.dcerpc import security
@ -267,8 +268,6 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2\"".encode('utf-16-le')).
SamDB(url=host_ldaps,
credentials=self.creds, lp=lp)
except LdbError as err:
HRES_SEC_E_INVALID_TOKEN = 0x80090308
num, estr = err.args
self.assertEqual(ERR_INVALID_CREDENTIALS, num)
self.assertIn(f"{HRES_SEC_E_INVALID_TOKEN:08X}", estr)

View File

@ -9,6 +9,7 @@ import time
sys.path.insert(0, "bin/python")
import samba
from samba import HRES_SEC_E_INVALID_TOKEN, HRES_SEC_E_LOGON_DENIED
from samba.tests.subunitrun import SubunitOptions, TestProgram
import samba.getopt as options
@ -1723,9 +1724,6 @@ class SamTests(samba.tests.TestCase):
return "%08X: LdapErr: DSID-%08X, comment: AcceptSecurityContext error, data %x, v" % (
hresult_v, dsid_v, werror_v)
HRES_SEC_E_LOGON_DENIED = 0x8009030C
HRES_SEC_E_INVALID_TOKEN = 0x80090308
sasl_bind_dsid = 0x0C0904DC
simple_bind_dsid = 0x0C0903A9