From: Stefan Metzmacher Date: Thu, 3 Apr 2025 08:49:30 +0000 (+0200) Subject: s4:libcli: remove unused ports from smbcli_full_connection() X-Git-Tag: tevent-0.17.0~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45d58ef5f8e1303e1bb7a4bb30f16d654aa87661;p=thirdparty%2Fsamba.git s4:libcli: remove unused ports from smbcli_full_connection() Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c index 0163daa2520..203652e71ed 100644 --- a/source4/client/cifsddio.c +++ b/source4/client/cifsddio.c @@ -235,7 +235,7 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct /* When we support SMB URLs, we can get different user credentials for * each connection, but for now, we just use the same one for both. */ - ret = smbcli_full_connection(NULL, &cli, host, ports, share, + ret = smbcli_full_connection(NULL, &cli, host, share, NULL /* devtype */, socket_options, samba_cmdline_get_creds(), diff --git a/source4/client/client.c b/source4/client/client.c index bbbe888bc36..08c56f55edc 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3219,7 +3219,7 @@ static bool do_connect(struct smbclient_context *ctx, return false; } - status = smbcli_full_connection(ctx, &ctx->cli, server, ports, + status = smbcli_full_connection(ctx, &ctx->cli, server, share, NULL, socket_options, cred, resolve_ctx, diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c index bac4ae7f8c4..9840e6f74ba 100644 --- a/source4/lib/policy/gp_filesys.c +++ b/source4/lib/policy/gp_filesys.c @@ -166,7 +166,6 @@ static NTSTATUS gp_cli_connect(struct gp_context *gp_ctx) return smbcli_full_connection(gp_ctx, &gp_ctx->cli, gp_ctx->active_dc->name, - lpcfg_smb_ports(gp_ctx->lp_ctx), "sysvol", NULL, lpcfg_socket_options(gp_ctx->lp_ctx), diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index f9fb18d9faa..c776efef1bf 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -163,7 +163,6 @@ out: NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, struct smbcli_state **ret_cli, const char *host, - const char **ports, const char *sharename, const char *devtype, const char *socket_options, diff --git a/source4/libcli/libcli.h b/source4/libcli/libcli.h index 27b7c36370e..9b15f31b1c9 100644 --- a/source4/libcli/libcli.h +++ b/source4/libcli/libcli.h @@ -104,7 +104,6 @@ NTSTATUS smbcli_tconX(struct smbcli_state *cli, const char *sharename, NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, struct smbcli_state **ret_cli, const char *host, - const char **ports, const char *sharename, const char *devtype, const char *socket_options, diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index b720261e565..11382d4b18d 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -162,7 +162,6 @@ static struct smbcli_state *connect_one(struct tevent_context *ev, printf("\\\\%s\\%s\n", server, share); status = smbcli_full_connection(NULL, &c, server, - lpcfg_smb_ports(lp_ctx), share, NULL, lpcfg_socket_options(lp_ctx), servers[snum], diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index e311769a43d..3719692b5f7 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -96,7 +96,6 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx, status = smbcli_full_connection(NULL, &c, server, - ports, share, NULL, socket_options, creds, diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index b13dffefe6c..bbbba9fb383 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -184,7 +184,6 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx, status = smbcli_full_connection(tctx, c, torture_setting_string(tctx, "host", NULL), - lpcfg_smb_ports(tctx->lp_ctx), torture_setting_string(tctx, "share", NULL), NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), diff --git a/source4/torture/raw/session.c b/source4/torture/raw/session.c index 76ae8089240..9ceb9897eac 100644 --- a/source4/torture/raw/session.c +++ b/source4/torture/raw/session.c @@ -267,7 +267,6 @@ static bool test_session_expire1(struct torture_context *tctx) status = smbcli_full_connection(tctx, &cli, host, - lpcfg_smb_ports(tctx->lp_ctx), share, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c index e514e7ae24f..65c6ceff2fd 100644 --- a/source4/torture/raw/tconrate.c +++ b/source4/torture/raw/tconrate.c @@ -99,7 +99,7 @@ static int fork_tcon_client(struct torture_context *tctx, NTSTATUS status; status = smbcli_full_connection(NULL, &cli, - host, lpcfg_smb_ports(tctx->lp_ctx), share, + host, share, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), lpcfg_resolve_context(tctx->lp_ctx), diff --git a/source4/torture/rpc/iremotewinspool_driver.c b/source4/torture/rpc/iremotewinspool_driver.c index 4e558ef742c..f91f86cc170 100644 --- a/source4/torture/rpc/iremotewinspool_driver.c +++ b/source4/torture/rpc/iremotewinspool_driver.c @@ -62,7 +62,6 @@ static bool smb_connect_print_share(struct torture_context *tctx, /* On Windows, SMB1 must be enabled! */ status = smbcli_full_connection(tctx, cli, server_name, - lpcfg_smb_ports(tctx->lp_ctx), share_name, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c index 6e0afcac281..23fcbfbfa34 100644 --- a/source4/torture/rpc/join.c +++ b/source4/torture/rpc/join.c @@ -35,7 +35,6 @@ bool torture_rpc_join(struct torture_context *torture) lpcfg_smbcli_session_options(torture->lp_ctx, &session_options); status = smbcli_full_connection(tj, &cli, host, - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), machine_account, @@ -63,7 +62,6 @@ bool torture_rpc_join(struct torture_context *torture) } status = smbcli_full_connection(tj, &cli, host, - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), machine_account, diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 3fc6f347a36..72f2b1f6252 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -193,7 +193,6 @@ bool torture_bind_authcontext(struct torture_context *torture) status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), @@ -428,7 +427,6 @@ static bool torture_bind_samba3(struct torture_context *torture) status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), @@ -1403,7 +1401,6 @@ static bool torture_netlogon_samba3(struct torture_context *torture) status = smbcli_full_connection(torture, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), @@ -1483,7 +1480,6 @@ static bool test_join3(struct torture_context *tctx, status = smbcli_full_connection(tctx, &cli, torture_setting_string(tctx, "host", NULL), - lpcfg_smb_ports(tctx->lp_ctx), "IPC$", NULL, lpcfg_socket_options(tctx->lp_ctx), smb_creds, lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, @@ -1808,7 +1804,7 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) status = smbcli_full_connection( torture, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, + "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), anon_creds, lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, @@ -1826,7 +1822,6 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) status = smbcli_full_connection( torture, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options, @@ -2465,7 +2460,6 @@ static bool torture_samba3_rpc_sharesec(struct torture_context *torture) status = smbcli_full_connection(torture, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), @@ -3430,7 +3424,6 @@ static bool torture_rpc_smb_reauth1(struct torture_context *torture) status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), @@ -3589,7 +3582,6 @@ static bool torture_rpc_smb_reauth2(struct torture_context *torture) status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), @@ -3988,7 +3980,6 @@ static bool torture_rpc_smb1_pipe_name(struct torture_context *torture) status = smbcli_full_connection(mem_ctx, &cli, torture_setting_string(torture, "host", NULL), - lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), samba_cmdline_get_creds(), diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index cff98b79e0b..7f0ce6e21c3 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -10793,7 +10793,6 @@ static bool connect_printer_driver_share(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, smbcli_full_connection(tctx, cli, server_name, - lpcfg_smb_ports(tctx->lp_ctx), share_name, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index cf3ea3786bf..3e4817c5243 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -63,7 +63,6 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); status = smbcli_full_connection(tctx, &cli, host, - lpcfg_smb_ports(tctx->lp_ctx), share, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(), lpcfg_resolve_context(tctx->lp_ctx), diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 28b1f87541b..7e61223e13b 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -85,7 +85,6 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options); status = smbcli_full_connection(tctx, &cli, host, - lpcfg_smb_ports(tctx->lp_ctx), share, NULL, lpcfg_socket_options(tctx->lp_ctx), creds, lpcfg_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 3bad0b0ed40..0556325594e 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -457,7 +457,6 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx, options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true); status = smbcli_full_connection(mem_ctx, c, hostname, - lpcfg_smb_ports(tctx->lp_ctx), sharename, NULL, lpcfg_socket_options(tctx->lp_ctx), samba_cmdline_get_creds(),