]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: pass struct smb_transports to do_connect()
authorStefan Metzmacher <metze@samba.org>
Sun, 6 Apr 2025 17:05:19 +0000 (19:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2025 10:17:29 +0000 (10:17 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/libsmb/clidfs.c

index dc0dc405b8769c451cda9c3d51d3238d5265f7a5..8390171f3c8db9f73a66925e118ce70284ed7b50 100644 (file)
@@ -134,7 +134,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
                                        const char *share,
                                        struct cli_credentials *creds,
                                        const struct sockaddr_storage *dest_ss,
-                                       int port,
+                                       const struct smb_transports *transports,
                                        int name_type,
                                        struct cli_state **pcli)
 {
@@ -151,7 +151,6 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
                cli_credentials_get_smb_encryption(creds);
        struct smb2_negotiate_contexts *in_contexts = NULL;
        struct smb2_negotiate_contexts *out_contexts = NULL;
-       struct smb_transports ts = smbsock_transports_from_port(port);
 
        if (encryption_state >= SMB_ENCRYPTION_DESIRED) {
                signing_state = SMB_SIGNING_REQUIRED;
@@ -187,7 +186,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
        status = cli_connect_nb(NULL,
                                server,
                                dest_ss,
-                               &ts,
+                               transports,
                                name_type,
                                NULL,
                                signing_state,
@@ -313,7 +312,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
                cli_shutdown(c);
                return do_connect(ctx, newserver,
                                newshare, creds,
-                               NULL, port, name_type, pcli);
+                               NULL, transports, name_type, pcli);
        }
 
        /* must be a normal share */
@@ -347,10 +346,11 @@ static NTSTATUS cli_cm_connect(TALLOC_CTX *ctx,
 {
        struct cli_state *cli = NULL;
        NTSTATUS status;
+       struct smb_transports ts = smbsock_transports_from_port(port);
 
        status = do_connect(ctx, server, share,
                                creds,
-                               dest_ss, port, name_type, &cli);
+                               dest_ss, &ts, name_type, &cli);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;