summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-11-20 14:32:40 +0100
committerStefan Metzmacher <metze@samba.org>2014-11-27 16:45:05 +0100
commitbc83e45a19deccfb0106c9ad79b0624b1c5d1fa7 (patch)
tree151ff2a05f30b9d0652cd08fb393d2effe3c6f89 /source4
parent55750f010423b0548e9d6b8f5745d7ad5fc4b773 (diff)
downloadsamba-bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7.tar.gz
samba-bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7.tar.xz
samba-bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7.zip
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 <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/raw/clitransport.c8
1 files changed, 8 insertions, 0 deletions
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);