From d63cdcfe9c73210c0b837d575d271c508134c5cd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 10 Apr 2025 16:48:48 +0200 Subject: [PATCH] s4:libcli: pass struct loadparm_context to smbcli_socket_connect() Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- source4/client/client.c | 4 +++- source4/libcli/cliconnect.c | 1 + source4/libcli/libcli.h | 1 + source4/torture/basic/base.c | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/client/client.c b/source4/client/client.c index d1954be912d..9ac1a5bc0a8 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3256,6 +3256,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const char *destip, int name_type, struct tevent_context *ev_ctx, + struct loadparm_context *lp_ctx, struct resolve_context *resolve_ctx, struct smbcli_options *options, const char *socket_options) @@ -3278,7 +3279,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, } ok = smbcli_socket_connect(cli, server_name, - ev_ctx, resolve_ctx, options, + ev_ctx, lp_ctx, resolve_ctx, options, socket_options, &calling, &called); if (!ok) { @@ -3524,6 +3525,7 @@ int main(int argc, char *argv[]) rc = do_message_op(lpcfg_netbios_name(lp_ctx), desthost, dest_ip, name_type, ev_ctx, + lp_ctx, lpcfg_resolve_context(lp_ctx), &smb_options, lpcfg_socket_options(lp_ctx)); diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index c776efef1bf..efe83c22262 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -33,6 +33,7 @@ */ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, struct tevent_context *ev_ctx, + struct loadparm_context *lp_ctx, struct resolve_context *resolve_ctx, struct smbcli_options *options, const char *socket_options, diff --git a/source4/libcli/libcli.h b/source4/libcli/libcli.h index 9b15f31b1c9..0bc70e92097 100644 --- a/source4/libcli/libcli.h +++ b/source4/libcli/libcli.h @@ -88,6 +88,7 @@ ssize_t smbcli_smbwrite(struct smbcli_tree *tree, bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, struct tevent_context *ev_ctx, + struct loadparm_context *lp_ctx, struct resolve_context *resolve_ctx, struct smbcli_options *options, const char *socket_options, diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 8baecf45539..e48e68d1a50 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -56,6 +56,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) ok = smbcli_socket_connect(cli, host, tctx->ev, + tctx->lp_ctx, lpcfg_resolve_context(tctx->lp_ctx), &options, lpcfg_socket_options(tctx->lp_ctx), -- 2.47.3