1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3:smbd: allow "server min protocol = SMB3_00" to go via "SMB 2.???" negprot

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12540

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit c207f2a989fc791b5f9bf9043d3c6ac31db5cdfd)
This commit is contained in:
Stefan Metzmacher 2017-01-18 08:37:30 +01:00 committed by Karolin Seeger
parent 1eb3f3d5ce
commit 2e7c776265

View File

@ -544,6 +544,8 @@ void reply_negprot(struct smb_request *req)
struct smbXsrv_connection *xconn = req->xconn;
struct smbd_server_connection *sconn = req->sconn;
bool signing_required = true;
int max_proto;
int min_proto;
START_PROFILE(SMBnegprot);
@ -688,11 +690,28 @@ void reply_negprot(struct smb_request *req)
FLAG_MSG_GENERAL|FLAG_MSG_SMBD
|FLAG_MSG_PRINT_GENERAL);
/*
* Anything higher than PROTOCOL_SMB2_10 still
* needs to go via "SMB 2.???", which is marked
* as PROTOCOL_SMB2_10.
*
* The real negotiation happens via reply_smb20ff()
* using SMB2 Negotiation.
*/
max_proto = lp_server_max_protocol();
if (max_proto > PROTOCOL_SMB2_10) {
max_proto = PROTOCOL_SMB2_10;
}
min_proto = lp_server_min_protocol();
if (min_proto > PROTOCOL_SMB2_10) {
min_proto = PROTOCOL_SMB2_10;
}
/* Check for protocols, most desirable first */
for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
i = 0;
if ((supported_protocols[protocol].protocol_level <= lp_server_max_protocol()) &&
(supported_protocols[protocol].protocol_level >= lp_server_min_protocol()))
if ((supported_protocols[protocol].protocol_level <= max_proto) &&
(supported_protocols[protocol].protocol_level >= min_proto))
while (i < num_cliprotos) {
if (strequal(cliprotos[i],supported_protocols[protocol].proto_name)) {
choice = i;