summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-04-26 12:15:10 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-05-12 02:09:28 +0200
commit34e35c4c80f8722d15770754393ce8673fc74a3b (patch)
treec16180ce9120bd90e806a61edad145127669714e /python
parent8d8ef48650ca5ec49f080be7f1fd813617aa6d31 (diff)
downloadsamba-34e35c4c80f8722d15770754393ce8673fc74a3b.tar.gz
samba-34e35c4c80f8722d15770754393ce8673fc74a3b.tar.bz2
samba-34e35c4c80f8722d15770754393ce8673fc74a3b.zip
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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/emulate/traffic.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py
index ea0529c4cb4..41ff1258519 100644
--- a/python/samba/emulate/traffic.py
+++ b/python/samba/emulate/traffic.py
@@ -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):