diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-11-20 14:32:40 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-11-27 16:45:05 +0100 |
commit | bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7 (patch) | |
tree | 151ff2a05f30b9d0652cd08fb393d2effe3c6f89 | |
parent | 55750f010423b0548e9d6b8f5745d7ad5fc4b773 (diff) | |
download | samba-bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7.tar.gz |
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>
-rw-r--r-- | source4/libcli/raw/clitransport.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index f9d96b58dfd..d0dd1f9dee6 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); |