From: Stefan Metzmacher Date: Mon, 19 Jun 2017 07:57:28 +0000 (+0200) Subject: s3:libsmb: add CLI_FULL_CONNECTION_DISABLE_SMB1 X-Git-Tag: tevent-0.9.32~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a81af6824c72b52b4be42003401741132f41b79;p=thirdparty%2Fsamba.git s3:libsmb: add CLI_FULL_CONNECTION_DISABLE_SMB1 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/include/client.h b/source3/include/client.h index b716a55f709..1fe3f1cb960 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -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 */ diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index b1b7e263e58..d98debc7771 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -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)) {