]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:client: Remove global max_protocol
authorAndreas Schneider <asn@samba.org>
Thu, 27 Aug 2020 14:40:49 +0000 (16:40 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 9 Oct 2020 19:16:46 +0000 (19:16 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/client/client.c

index 7ab948e79ddd9afd482f5a2e78aaaaa1e34d0fce..94d7b57647c35dc231ddf7ea82fba69565f87bac 100644 (file)
@@ -60,7 +60,6 @@ static int io_bufsize = 0; /* we use the default size */
 static int io_timeout = (CLIENT_TIMEOUT/1000); /* Per operation timeout (in seconds). */
 
 static int name_type = 0x20;
-static int max_protocol = -1;
 
 static int process_tok(char *tok);
 static int cmd_help(void);
@@ -5645,7 +5644,7 @@ static int process_command_string(const char *cmd_in)
                                     desthost,
                                     service,
                                     creds,
-                                    max_protocol,
+                                    lp_client_max_protocol(),
                                     have_ip ? &dest_ss : NULL, port,
                                     name_type,
                                     &cli);
@@ -6095,7 +6094,7 @@ static int process(const char *base_directory)
                             desthost,
                             service,
                             creds,
-                            max_protocol,
+                            lp_client_max_protocol(),
                             have_ip ? &dest_ss : NULL, port,
                             name_type, &cli);
        if (!NT_STATUS_IS_OK(status)) {
@@ -6136,7 +6135,7 @@ static int do_host_query(const char *query_host)
                             query_host,
                             "IPC$",
                             creds,
-                            max_protocol,
+                            lp_client_max_protocol(),
                             have_ip ? &dest_ss : NULL, port,
                             name_type, &cli);
        if (!NT_STATUS_IS_OK(status)) {
@@ -6171,7 +6170,7 @@ static int do_host_query(const char *query_host)
        if (port != NBT_SMB_PORT ||
            smbXcli_conn_protocol(cli->conn) > PROTOCOL_NT1)
        {
-               int max_proto = MIN(max_protocol, PROTOCOL_NT1);
+               int max_proto = MIN(lp_client_max_protocol(), PROTOCOL_NT1);
 
                /*
                 * Workgroups simply don't make sense over anything
@@ -6221,7 +6220,7 @@ static int do_tar_op(const char *base_directory)
                                     desthost,
                                     service,
                                     creds,
-                                    max_protocol,
+                                    lp_client_max_protocol(),
                                     have_ip ? &dest_ss : NULL, port,
                                     name_type, &cli);
                if (!NT_STATUS_IS_OK(status)) {
@@ -6628,8 +6627,6 @@ int main(int argc,char *argv[])
        /* Ensure we have a password (or equivalent). */
        popt_common_credentials_post();
 
-       max_protocol = lp_client_max_protocol();
-
        if (tar_to_process(tar_ctx)) {
                if (cmdstr)
                        process_command_string(cmdstr);