s3:smb2_negprot: add support for SMB2_22
authorStefan Metzmacher <metze@samba.org>
Sat, 19 Nov 2011 13:02:22 +0000 (14:02 +0100)
committerStefan Metzmacher <metze@samba.org>
Sun, 20 Nov 2011 15:46:45 +0000 (16:46 +0100)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Nov 20 16:46:45 CET 2011 on sn-devel-104

source3/smbd/smb2_negprot.c

index ba556620949070cae0f00b224e100bef19e41da3..61d20082d8b37f3eedb783f089f11b12f00f15b4 100644 (file)
@@ -118,6 +118,21 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
        }
        indyn = (const uint8_t *)req->in.vector[i+2].iov_base;
 
+       for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
+               if (lp_maxprotocol() < PROTOCOL_SMB2_22) {
+                       break;
+               }
+               if (lp_minprotocol() > PROTOCOL_SMB2_22) {
+                       break;
+               }
+
+               dialect = SVAL(indyn, c*2);
+               if (dialect == SMB2_DIALECT_REVISION_222) {
+                       protocol = PROTOCOL_SMB2_22;
+                       break;
+               }
+       }
+
        for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
                if (lp_maxprotocol() < PROTOCOL_SMB2_10) {
                        break;