s3:libsmb: add CLI_FULL_CONNECTION_FORCE_SMB1
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Jun 2017 06:16:57 +0000 (08:16 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jun 2017 11:07:40 +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 38fba01142dcd1bb08e81846c899db1f4adb6f53..b716a55f70917cdd044f25322d9b49f77f7ee045 100644 (file)
@@ -125,5 +125,6 @@ struct file_info {
 #define CLI_FULL_CONNECTION_FORCE_DOS_ERRORS 0x0080
 #define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100
 #define CLI_FULL_CONNECTION_USE_NT_HASH 0x0200
+#define CLI_FULL_CONNECTION_FORCE_SMB1 0x0400
 
 #endif /* _CLIENT_H */
index e01253f450408911971181c0bfade226b9a83f58..b1b7e263e5833a661259f06659c63264efab35cd 100644 (file)
@@ -2780,6 +2780,10 @@ static struct tevent_req *cli_start_connection_send(
                state->max_protocol = lp_client_max_protocol();
        }
 
+       if (flags & CLI_FULL_CONNECTION_FORCE_SMB1) {
+               state->max_protocol = MIN(state->max_protocol, PROTOCOL_NT1);
+       }
+
        subreq = cli_connect_nb_send(state, ev, dest_host, dest_ss, port,
                                     0x20, my_name, signing_state, flags);
        if (tevent_req_nomem(subreq, req)) {