s3:client: avoid interpret_protocol()
authorStefan Metzmacher <metze@samba.org>
Sun, 11 Aug 2013 11:08:49 +0000 (13:08 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Aug 2013 07:07:05 +0000 (09:07 +0200)
lp_set_cmdline("client max protocol",...) and
lp_cli_maxprotocol() are the more generic solution.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/client/client.c

index 1f6305265105591293a9dc1dd2ebaa90eb1ce60d..44e1efd6db0ea20448bbf7314bb07c5945c204fa 100644 (file)
@@ -58,7 +58,7 @@ const char *cmd_ptr = NULL;
 static int io_bufsize = 524288;
 
 static int name_type = 0x20;
-static int max_protocol = PROTOCOL_NT1;
+static int max_protocol = -1;
 
 static int process_tok(char *tok);
 static int cmd_help(void);
@@ -5456,7 +5456,7 @@ static int do_message_op(struct user_auth_info *a_info)
                        }
                        break;
                case 'm':
-                       max_protocol = interpret_protocol(poptGetOptArg(pc), max_protocol);
+                       lp_set_cmdline("client max protocol", poptGetOptArg(pc));
                        break;
                case 'T':
                        /* We must use old option processing for this. Find the
@@ -5574,6 +5574,8 @@ static int do_message_op(struct user_auth_info *a_info)
        /* Ensure we have a password (or equivalent). */
        set_cmdline_auth_info_getpass(auth_info);
 
+       max_protocol = lp_cli_maxprotocol();
+
        if (tar_type) {
                if (cmdstr)
                        process_command_string(cmdstr);