]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: pass struct smb_transports to SMBC_server_internal()
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/libsmb_server.c

index 043f640601f110e40606e954f3fcda18f590ba41..c8ded4e9d911d747965fbe23ee67740afe8e0902 100644 (file)
@@ -348,7 +348,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
             SMBCCTX *context,
             bool connect_if_not_found,
             const char *server,
-            uint16_t port,
+            const struct smb_transports *transports,
             const char *share,
             char **pp_workgroup,
             char **pp_username,
@@ -369,7 +369,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
        struct smbXcli_tcon *tcon = NULL;
        int signing_state = SMB_SIGNING_DEFAULT;
        struct cli_credentials *creds = NULL;
-       struct smb_transports ats = smbsock_transports_from_port(port);
+       struct smb_transports ats = *transports;
        uint8_t ati;
        const struct smb_transports *ts = &ats;
        struct smb_transports ots = { .num_transports = 0, };
@@ -652,7 +652,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
                                creds)) {
                cli_shutdown(c);
                srv = SMBC_server_internal(ctx, context, connect_if_not_found,
-                               newserver, port, newshare, pp_workgroup,
+                               newserver, &ats, newshare, pp_workgroup,
                                pp_username, pp_password, in_cache);
                TALLOC_FREE(newserver);
                TALLOC_FREE(newshare);
@@ -762,9 +762,10 @@ SMBC_server(TALLOC_CTX *ctx,
 {
        SMBCSRV *srv=NULL;
        bool in_cache = false;
+       struct smb_transports ts = smbsock_transports_from_port(port);
 
        srv = SMBC_server_internal(ctx, context, connect_if_not_found,
-                       server, port, share, pp_workgroup,
+                       server, &ts, share, pp_workgroup,
                        pp_username, pp_password, &in_cache);
 
        if (!srv) {