From 72f98f9763669887482cf430c7734b0a0d69cc1b Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Wed, 2 May 2018 22:12:51 +0000 Subject: traffic: change machine creds secure channel type SEC_CHAN_WKSTA --> SEC_CHAN_BDC This will fix netlogon failure against windows. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam --- python/samba/emulate/traffic.py | 6 +++--- python/samba/emulate/traffic_packets.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index 503e1e4c5bf..2dc27d95100 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -44,7 +44,7 @@ from samba.credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS from samba.auth import system_session from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_PASSWD_NOTREQD from samba.dsdb import UF_NORMAL_ACCOUNT -from samba.dcerpc.misc import SEC_CHAN_WKSTA +from samba.dcerpc.misc import SEC_CHAN_BDC from samba import gensec from samba import sd_utils @@ -511,7 +511,7 @@ class ReplayContext(object): self.machine_creds = Credentials() self.machine_creds.guess(self.lp) self.machine_creds.set_workstation(self.netbios_name) - self.machine_creds.set_secure_channel_type(SEC_CHAN_WKSTA) + self.machine_creds.set_secure_channel_type(SEC_CHAN_BDC) self.machine_creds.set_password(self.machinepass) self.machine_creds.set_username(self.netbios_name + "$") self.machine_creds.set_domain(self.domain) @@ -523,7 +523,7 @@ class ReplayContext(object): self.machine_creds_bad = Credentials() self.machine_creds_bad.guess(self.lp) self.machine_creds_bad.set_workstation(self.netbios_name) - self.machine_creds_bad.set_secure_channel_type(SEC_CHAN_WKSTA) + self.machine_creds_bad.set_secure_channel_type(SEC_CHAN_BDC) self.machine_creds_bad.set_password(self.machinepass[:-4]) self.machine_creds_bad.set_username(self.netbios_name + "$") if self.prefer_kerberos: diff --git a/python/samba/emulate/traffic_packets.py b/python/samba/emulate/traffic_packets.py index 1413c8bfb80..3f5db4317a3 100644 --- a/python/samba/emulate/traffic_packets.py +++ b/python/samba/emulate/traffic_packets.py @@ -35,7 +35,6 @@ from samba.ntstatus import ( NT_STATUS_OBJECT_NAME_NOT_FOUND, NT_STATUS_NO_SUCH_DOMAIN ) -from samba.dcerpc.misc import SEC_CHAN_WKSTA import samba samba.ensure_third_party_module("dns", "dnspython") import dns.resolver @@ -573,7 +572,7 @@ def packet_rpc_netlogon_30(packet, conversation, context): # must ends with $, so use get_username instead # of get_workstation here context.machine_creds.get_username(), - SEC_CHAN_WKSTA, + context.machine_creds.get_secure_channel_type(), context.netbios_name, auth, pwd) -- cgit v1.2.3