struct tevent_req *cli_full_connection_creds_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
const char *my_name, const char *dest_host,
- const struct sockaddr_storage *dest_ss, int port,
+ const struct sockaddr_storage *dest_ss,
+ const struct smb_transports *transports,
const char *service, const char *service_type,
struct cli_credentials *creds,
int flags,
state->service_type = service_type;
state->creds = creds;
state->flags = flags;
- state->transports = smbsock_transports_from_port(port);
+ state->transports = *transports;
if (flags & CLI_FULL_CONNECTION_IPC) {
signing_state = cli_credentials_get_smb_ipc_signing(creds);
struct tevent_context *ev;
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
+ struct smb_transports ts = smbsock_transports_from_port(port);
ev = samba_tevent_context_init(mem_ctx);
if (ev == NULL) {
goto fail;
}
req = cli_full_connection_creds_send(
- ev, ev, my_name, dest_host, dest_ss, port, service,
+ ev, ev, my_name, dest_host, dest_ss, &ts, service,
service_type, creds, flags,
NULL);
if (req == NULL) {
struct tevent_req *cli_full_connection_creds_send(
TALLOC_CTX *mem_ctx, struct tevent_context *ev,
const char *my_name, const char *dest_host,
- const struct sockaddr_storage *dest_ss, int port,
+ const struct sockaddr_storage *dest_ss,
+ const struct smb_transports *transports,
const char *service, const char *service_type,
struct cli_credentials *creds,
int flags,
- struct smb2_negotiate_contexts *negotiate_contexts);
+ struct smb2_negotiate_contexts *negotiate_contexts)
+ NONNULL(2) NONNULL(6);
NTSTATUS cli_full_connection_creds_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
struct cli_state **output_cli);
#include "includes.h"
#include "python/py3compat.h"
#include "python/modules.h"
+#include "param/pyparam.h"
#include "libcli/smb/smbXcli_base.h"
#include "libcli/smb/smb2_negotiate_context.h"
#include "libcli/smb/reparse.h"
PyObject *creds = NULL;
struct cli_credentials *cli_creds;
PyObject *py_lp = Py_None;
+ struct loadparm_context *lp_ctx = NULL;
PyObject *py_multi_threaded = Py_False;
bool multi_threaded = false;
PyObject *py_force_smb1 = Py_False;
PyObject *py_posix = Py_False;
PyObject *py_negotiate_contexts = NULL;
struct smb2_negotiate_contexts *negotiate_contexts = NULL;
+ struct smb_transports ts = { .num_transports = 0, };
bool use_ipc = false;
bool request_posix = false;
struct tevent_req *req;
cli_creds = PyCredentials_AsCliCredentials(creds);
}
+ lp_ctx = lpcfg_from_py_object(frame, py_lp);
+ if (lp_ctx == NULL) {
+ TALLOC_FREE(frame);
+ return -1;
+ }
+
+ ts = smb_transports_parse("client smb transports",
+ lpcfg_client_smb_transports(lp_ctx));
+
req = cli_full_connection_creds_send(
- frame, self->ev, "myname", host, NULL, 0, share, "?????",
+ frame, self->ev, "myname", host, NULL, &ts, share, "?????",
cli_creds, flags,
negotiate_contexts);
if (!py_tevent_req_wait_exc(self, req)) {