summaryrefslogtreecommitdiffstats
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/smb2/connect.c3
-rw-r--r--source4/libcli/smb2/transport.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index c81bd67fba..9535380d64 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -149,7 +149,8 @@ static void smb2_connect_socket_done(struct composite_context *creq)
subreq = smbXcli_negprot_send(state, state->ev,
state->transport->conn, timeout_msec,
- PROTOCOL_SMB2_02, PROTOCOL_LATEST);
+ PROTOCOL_SMB2_02,
+ state->transport->options.max_protocol);
if (tevent_req_nomem(subreq, req)) {
return;
}
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 9b0c1461fd..e3b2954dd4 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -55,6 +55,14 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
transport->ev = sock->event.ctx;
transport->options = *options;
+ if (transport->options.max_protocol == PROTOCOL_DEFAULT) {
+ transport->options.max_protocol = PROTOCOL_LATEST;
+ }
+
+ if (transport->options.max_protocol < PROTOCOL_SMB2_02) {
+ transport->options.max_protocol = PROTOCOL_LATEST;
+ }
+
TALLOC_FREE(sock->event.fde);
TALLOC_FREE(sock->event.te);