1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-19 18:50:24 +03:00

traffic: add credentials to samr

lp and creds are missing in SamrContext and samr connection.
While run traffic_replay against windows, this will cause
`Access Denied` error.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Joe Guo 2018-04-26 12:15:10 +12:00 committed by Andrew Bartlett
parent 8d8ef48650
commit 34e35c4c80

View File

@ -670,7 +670,8 @@ class ReplayContext(object):
def get_samr_context(self, new=False):
if not self.samr_contexts or new:
self.samr_contexts.append(SamrContext(self.server))
self.samr_contexts.append(
SamrContext(self.server, lp=self.lp, creds=self.creds))
return self.samr_contexts[-1]
def get_netlogon_connection(self):
@ -707,7 +708,7 @@ class ReplayContext(object):
class SamrContext(object):
"""State/Context associated with a samr connection.
"""
def __init__(self, server):
def __init__(self, server, lp=None, creds=None):
self.connection = None
self.handle = None
self.domain_handle = None
@ -716,10 +717,16 @@ class SamrContext(object):
self.user_handle = None
self.rids = None
self.server = server
self.lp = lp
self.creds = creds
def get_connection(self):
if not self.connection:
self.connection = samr.samr("ncacn_ip_tcp:%s" % (self.server))
self.connection = samr.samr(
"ncacn_ip_tcp:%s[seal]" % (self.server),
lp_ctx=self.lp,
credentials=self.creds)
return self.connection
def get_handle(self):