s3:libsmb: add CLI_FULL_CONNECTION_DISABLE_SMB1
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Jun 2017 07:57:28 +0000 (09:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jun 2017 11:07:41 +0000 (13:07 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/client.h
source3/libsmb/cliconnect.c

index b716a55f70917cdd044f25322d9b49f77f7ee045..1fe3f1cb96083507c797495ebd3c8d632cb05a73 100644 (file)
@@ -126,5 +126,6 @@ struct file_info {
 #define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100
 #define CLI_FULL_CONNECTION_USE_NT_HASH 0x0200
 #define CLI_FULL_CONNECTION_FORCE_SMB1 0x0400
+#define CLI_FULL_CONNECTION_DISABLE_SMB1 0x0800
 
 #endif /* _CLIENT_H */
index b1b7e263e5833a661259f06659c63264efab35cd..d98debc7771815b35c2cf20f167ffd348f66c7ef 100644 (file)
@@ -2784,6 +2784,11 @@ static struct tevent_req *cli_start_connection_send(
                state->max_protocol = MIN(state->max_protocol, PROTOCOL_NT1);
        }
 
+       if (flags & CLI_FULL_CONNECTION_DISABLE_SMB1) {
+               state->min_protocol = MAX(state->max_protocol, PROTOCOL_SMB2_02);
+               state->max_protocol = MAX(state->max_protocol, PROTOCOL_LATEST);
+       }
+
        subreq = cli_connect_nb_send(state, ev, dest_host, dest_ss, port,
                                     0x20, my_name, signing_state, flags);
        if (tevent_req_nomem(subreq, req)) {