diff options
author | Garming Sam <garming@catalyst.net.nz> | 2018-01-08 13:36:59 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-02-22 23:15:16 +0100 |
commit | 5c625eae3f54e8de434de26e9f6a0f2fde557c18 (patch) | |
tree | d1ccb70afa1509e563c0c4465d2e780a884fe9fa /python | |
parent | e039e9b0d2a16b21ace019b028e5c8244486b8a3 (diff) | |
download | samba-5c625eae3f54e8de434de26e9f6a0f2fde557c18.tar.gz |
tests/py_creds: Add a SamLogonEx test with an empty string domain
This test passes against 4.6, but failed against 4.7.5 and master.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13206
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/tests/py_credentials.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/python/samba/tests/py_credentials.py b/python/samba/tests/py_credentials.py index ff017ec7b7b..2f5a7d61a12 100644 --- a/python/samba/tests/py_credentials.py +++ b/python/samba/tests/py_credentials.py @@ -129,6 +129,33 @@ class PyCredentialsTests(TestCase): else: raise + def test_SamLogonEx_no_domain(self): + c = self.get_netlogon_connection() + + self.user_creds.set_domain('') + + logon = samlogon_logon_info(self.domain, + self.machine_name, + self.user_creds) + + logon_level = netlogon.NetlogonNetworkTransitiveInformation + validation_level = netlogon.NetlogonValidationSamInfo4 + netr_flags = 0 + + try: + c.netr_LogonSamLogonEx(self.server, + self.user_creds.get_workstation(), + logon_level, + logon, + validation_level, + netr_flags) + except NTSTATUSError as e: + enum = ctypes.c_uint32(e[0]).value + if enum == ntstatus.NT_STATUS_WRONG_PASSWORD: + self.fail("got wrong password error") + else: + self.fail("got unexpected error" + str(e)) + def test_SamLogonExNTLM(self): c = self.get_netlogon_connection() |