mirror of
https://github.com/samba-team/samba.git
synced 2025-12-06 16:23:49 +03:00
python:tests: Set smb ipc signing via the creds API
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
1a74c790bf
commit
67323b1ffa
@@ -35,14 +35,18 @@ from samba.ntstatus import (
|
||||
from samba import NTSTATUSError
|
||||
from samba.samba3 import param as s3param
|
||||
from samba.samba3 import libsmb_samba_internal as libsmb
|
||||
from samba.credentials import SMB_SIGNING_REQUIRED
|
||||
|
||||
class smb_pipe_socket(object):
|
||||
|
||||
def __init__(self, target_hostname, pipename, creds, impersonation_level, lp):
|
||||
lp3 = s3param.get_context()
|
||||
lp3.load(lp.configfile)
|
||||
saved_signing_state = creds.get_smb_ipc_signing()
|
||||
creds.set_smb_ipc_signing(SMB_SIGNING_REQUIRED)
|
||||
self.smbconn = libsmb.Conn(target_hostname, 'IPC$', lp3,
|
||||
creds=creds, ipc=True, sign=True)
|
||||
creds.set_smb_ipc_signing(saved_signing_state)
|
||||
self.smbfid = self.smbconn.create(pipename,
|
||||
DesiredAccess=0x12019f,
|
||||
ShareAccess=0x7,
|
||||
|
||||
Reference in New Issue
Block a user