]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:libcli: pass struct loadparm_context to smb2_connect()
authorStefan Metzmacher <metze@samba.org>
Thu, 10 Apr 2025 14:48:48 +0000 (16:48 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2025 10:17:30 +0000 (10:17 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
13 files changed:
source4/libcli/smb2/connect.c
source4/torture/gentest.c
source4/torture/rpc/fsrvp.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/spoolss.c
source4/torture/smb2/credits.c
source4/torture/smb2/ioctl.c
source4/torture/smb2/multichannel.c
source4/torture/smb2/oplock.c
source4/torture/smb2/replay.c
source4/torture/smb2/scan.c
source4/torture/smb2/session.c
source4/torture/smb2/util.c

index f1a9164f9f33015330da85b2d0f13c0c3afd99e3..f800a560236b90a8a28e7c8f5e4e205c9750e526 100644 (file)
@@ -451,6 +451,7 @@ NTSTATUS smb2_connect_ext(TALLOC_CTX *mem_ctx,
 NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
                      const char *host,
                      const char *share,
+                     struct loadparm_context *lp_ctx,
                      struct resolve_context *resolve_ctx,
                      struct cli_credentials *credentials,
                      struct smb2_tree **tree,
index d9f6dfac97bb68314722d6190c27972e5b9a2156..610403c2cd4a062aff79c965ad3011387db82088 100644 (file)
@@ -231,6 +231,7 @@ static bool connect_servers(struct tevent_context *ev,
                        if (options.smb2) {
                                status = smb2_connect(NULL, servers[i].server_name,
                                                      servers[i].share_name,
+                                                     lp_ctx,
                                                      lpcfg_resolve_context(lp_ctx),
                                                      servers[i].credentials,
                                                      &servers[i].smb2_tree[j],
index e6f7fddfdaedcff4ffecd2bf15fc7fa48a96ab77..d276eb1522fba8a1e479a5ed45117f50b3125f2b 100644 (file)
@@ -554,6 +554,7 @@ static bool test_fsrvp_sc_share_io(struct torture_context *tctx,
        status = smb2_connect(tmp_ctx,
                              dcerpc_server_name(p),
                              FSHARE,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree_base,
@@ -584,6 +585,7 @@ static bool test_fsrvp_sc_share_io(struct torture_context *tctx,
        status = smb2_connect(tmp_ctx,
                              dcerpc_server_name(p),
                              sc_map->ShadowCopyShareName,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree_snap,
@@ -676,6 +678,7 @@ static bool test_fsrvp_enum_created(struct torture_context *tctx,
        status = smb2_connect(tmp_ctx,
                              dcerpc_server_name(p),
                              FSHARE,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree_base,
index 72f2b1f6252bfcf089d3997869f1e24dff823015..ae8b202252b1963b2dfdba9bc347ac296adc6cb0 100644 (file)
@@ -3715,6 +3715,7 @@ static bool torture_rpc_smb2_reauth1(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -3864,6 +3865,7 @@ static bool torture_rpc_smb2_reauth2(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4229,6 +4231,7 @@ static bool torture_rpc_smb2_pipe_name(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4322,6 +4325,7 @@ static bool torture_rpc_smb2_pipe_read_close(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4405,6 +4409,7 @@ static bool torture_rpc_smb2_pipe_read_tdis(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4488,6 +4493,7 @@ static bool torture_rpc_smb2_pipe_read_logoff(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              host,
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4566,6 +4572,7 @@ static bool torture_rpc_lsa_over_netlogon(struct torture_context *torture)
        status = smb2_connect(mem_ctx,
                              torture_setting_string(torture, "host", NULL),
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
@@ -4636,6 +4643,7 @@ static bool torture_rpc_pipes_supported_interfaces(
        status = smb2_connect(mem_ctx,
                              torture_setting_string(torture, "host", NULL),
                              "IPC$",
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
index 7f0ce6e21c3bc68b8d884d8e15f06f14b43c19b9..eae67bae43952bdbdd2fd0bbed6cc2000b1584a4 100644 (file)
@@ -8971,6 +8971,7 @@ static bool test_print_test_smbd(struct torture_context *tctx,
        status = smb2_connect(mem_ctx,
                              torture_setting_string(tctx, "host", NULL),
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree,
index 219deb9ca8ffe868a60d7a153674d6b92912d947..d43802730a8c70ea4fdd8432493bd7720aa27671 100644 (file)
@@ -714,6 +714,7 @@ static bool test_ipc_max_data_zero(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1,
@@ -761,6 +762,7 @@ static bool test_1conn_ipc_max_async_credits(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1,
@@ -819,6 +821,7 @@ static bool test_2conn_ipc_max_async_credits(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1,
@@ -836,6 +839,7 @@ static bool test_2conn_ipc_max_async_credits(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree2,
@@ -899,6 +903,7 @@ static bool test_multichannel_ipc_max_async_credits(
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1a,
@@ -916,6 +921,7 @@ static bool test_multichannel_ipc_max_async_credits(
        status = smb2_connect(tree1a,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1b_base,
@@ -1469,6 +1475,7 @@ static bool test_multichannel_notify_max_async_credits(
        status = smb2_connect(tree1a,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree1b_base,
index 7a0a7e51c3671d9df4ab6ed77f9e565893759e1f..e62ea9f065c74514d458e81175d26b76d0c5a7c2 100644 (file)
@@ -7184,6 +7184,7 @@ static bool test_ioctl_bug14788_VALIDATE_NEGOTIATE(struct torture_context *tortu
        status = smb2_connect(torture,
                              host,
                              share,
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              credentials,
                              &tree,
@@ -7286,6 +7287,7 @@ static bool test_ioctl_bug14788_NETWORK_INTERFACE(struct torture_context *tortur
        status = smb2_connect(torture,
                              host,
                              share,
+                             torture->lp_ctx,
                              lpcfg_resolve_context(torture->lp_ctx),
                              credentials,
                              &tree,
index 2e564dc3d4d367d0b606189e776bc7646acb1044..8c0e0a3f05ec2a3b8576a5102be0fdee45329660 100644 (file)
@@ -220,6 +220,7 @@ static struct smb2_tree *test_multichannel_create_channel(
        status = smb2_connect(tctx,
                        host,
                        share,
+                       tctx->lp_ctx,
                        lpcfg_resolve_context(tctx->lp_ctx),
                        credentials,
                        &tree,
@@ -2018,6 +2019,7 @@ static bool test_multichannel_num_channels(struct torture_context *tctx,
                        smb2_connect(tctx,
                                host,
                                share,
+                               tctx->lp_ctx,
                                lpcfg_resolve_context(tctx->lp_ctx),
                                credentials,
                                &tree2[i],
index b25d5a6606ec5058749ad80b7538b5eff52fadb9..8215159d88d8620a58110c6d7de3e82b28f55383 100644 (file)
@@ -292,6 +292,7 @@ static bool open_smb2_connection_no_level2_oplocks(struct torture_context *tctx,
        options.use_level2_oplocks = false;
 
        status = smb2_connect(tctx, host, share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              tree, tctx->ev, &options,
index 6d410a71ebab62b4c044329a990bdcbaa99839a5..5c93fda3d4453635c964533704f86b2d7a4d4e74 100644 (file)
@@ -2837,6 +2837,7 @@ static bool _test_dhv2_pending2_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_2,
@@ -2866,6 +2867,7 @@ static bool _test_dhv2_pending2_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_3,
@@ -2895,6 +2897,7 @@ static bool _test_dhv2_pending2_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_4,
@@ -3670,6 +3673,7 @@ static bool _test_dhv2_pending3_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_2,
@@ -3699,6 +3703,7 @@ static bool _test_dhv2_pending3_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_3,
@@ -3728,6 +3733,7 @@ static bool _test_dhv2_pending3_vs_hold(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_4,
@@ -4764,6 +4770,7 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
        status = smb2_connect(tctx,
                        host,
                        share,
+                       tctx->lp_ctx,
                        lpcfg_resolve_context(tctx->lp_ctx),
                        samba_cmdline_get_creds(),
                        &tree2,
@@ -4985,6 +4992,7 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
        status = smb2_connect(tctx,
                        host,
                        share,
+                       tctx->lp_ctx,
                        lpcfg_resolve_context(tctx->lp_ctx),
                        samba_cmdline_get_creds(),
                        &tree2,
index 570b6112e386fda9f6cbec8ba021b1544f62defd..d73168e1a1de3cdfcdcad4eb842a649fe1089870 100644 (file)
@@ -213,6 +213,7 @@ static bool torture_smb2_scan(struct torture_context *tctx)
 
        status = smb2_connect(mem_ctx, host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              &tree, tctx->ev, &options,
@@ -230,6 +231,7 @@ static bool torture_smb2_scan(struct torture_context *tctx)
                        talloc_free(tree);
                        status = smb2_connect(mem_ctx, host,
                                              share,
+                                             tctx->lp_ctx,
                                              lpcfg_resolve_context(tctx->lp_ctx),
                                              samba_cmdline_get_creds(),
                                              &tree, tctx->ev, &options,
index ca1d6ca8a3734129df3d6ac0dff2896ca5ca466a..f8f4eac511f5faf22a92fc789673f870522d81bb 100644 (file)
@@ -1127,6 +1127,7 @@ static bool test_session_expire1i(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree,
@@ -1371,6 +1372,7 @@ static bool test_session_expire2i(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree,
@@ -1789,6 +1791,7 @@ static bool test_session_expire_disconnect(struct torture_context *tctx)
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree,
@@ -1927,6 +1930,7 @@ bool test_session_bind1(struct torture_context *tctx, struct smb2_tree *tree1)
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2,
@@ -2093,6 +2097,7 @@ static bool test_session_bind2(struct torture_context *tctx, struct smb2_tree *t
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2,
@@ -2131,6 +2136,7 @@ static bool test_session_bind2(struct torture_context *tctx, struct smb2_tree *t
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree3,
@@ -2387,6 +2393,7 @@ static bool test_session_bind_auth_mismatch(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              creds1,
                              &tree2,
@@ -2683,6 +2690,7 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree1,
@@ -2721,6 +2729,7 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials,
                              &tree2_0,
@@ -5124,6 +5133,7 @@ static bool test_session_sign_enc(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              credentials1,
                              &tree1,
@@ -5612,6 +5622,7 @@ static bool test_session_anon_encryption1(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              anon_creds,
                              &anon_tree,
@@ -5744,6 +5755,7 @@ static bool test_session_anon_encryption2(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              user_creds,
                              &user_tree,
@@ -5890,6 +5902,7 @@ static bool test_session_anon_encryption3(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              user_creds,
                              &user_tree,
@@ -6007,6 +6020,7 @@ static bool test_session_anon_signing1(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              anon_creds,
                              &anon_tree,
@@ -6106,6 +6120,7 @@ static bool test_session_anon_signing2(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              anon_creds,
                              &anon_tree,
@@ -6302,6 +6317,7 @@ static bool test_session_require_sign_bug15397(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              creds,
                              &tree,
index 998b1e8020b3c1e5e4e212d3dde6aae1b9a74d9b..00f69030f8263c8a94a166ca28f7b101e84e0152 100644 (file)
@@ -472,6 +472,7 @@ bool torture_smb2_con_share(struct torture_context *tctx,
        status = smb2_connect(tctx,
                              host,
                              share,
+                             tctx->lp_ctx,
                              lpcfg_resolve_context(tctx->lp_ctx),
                              samba_cmdline_get_creds(),
                              tree,