From bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 20 Nov 2014 14:32:40 +0100 Subject: s4:libcli/raw: fix up the max_protocol value for the current transport connection This allows the caller to pass PROTOCOL_DEFAULT, which results in PROTOCOL_NT1. As smbcli_transport_init() is about SMB1 only we downgrade to PROTOCOL_NT1 if a higher value (for SMB2 or SMB3) was given. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/libcli/raw/clitransport.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index f9d96b58df..d0dd1f9dee 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -58,6 +58,14 @@ struct smbcli_transport *smbcli_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_NT1; + } + + if (transport->options.max_protocol > PROTOCOL_NT1) { + transport->options.max_protocol = PROTOCOL_NT1; + } + TALLOC_FREE(sock->event.fde); TALLOC_FREE(sock->event.te); -- cgit