summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-26 08:44:27 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-26 09:50:45 +0200
commitfadffbae88335a45f23d4861c6a097bccb191069 (patch)
treec23fdc67e70085a92ee2cefe79fa79f086ddc788 /source4/smb_server
parent01b05df766cf55c356af495151ac665a82a57c4b (diff)
downloadsamba-fadffbae88335a45f23d4861c6a097bccb191069.tar.gz
samba-fadffbae88335a45f23d4861c6a097bccb191069.tar.bz2
samba-fadffbae88335a45f23d4861c6a097bccb191069.zip
s4:smb2srv: We only support SMB 2.002.
We need to loop over all given dialects and check if we can find SMB2_DIALECT_REVISION_202. metze
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/smb/negprot.c1
-rw-r--r--source4/smb_server/smb2/negprot.c17
2 files changed, 12 insertions, 6 deletions
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index c3399fdd48..5ac5624745 100644
--- a/source4/smb_server/smb/negprot.c
+++ b/source4/smb_server/smb/negprot.c
@@ -469,7 +469,6 @@ static const struct {
int protocol_level;
} supported_protocols[] = {
{"SMB 2.002", "SMB2", reply_smb2, PROTOCOL_SMB2},
- {"SMB 2.001", "SMB2", reply_smb2, PROTOCOL_SMB2},
{"NT LANMAN 1.0", "NT1", reply_nt1, PROTOCOL_NT1},
{"NT LM 0.12", "NT1", reply_nt1, PROTOCOL_NT1},
{"LANMAN2.1", "LANMAN2", reply_lanman2, PROTOCOL_LANMAN2},
diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c
index 0b65a19634..f915392ffa 100644
--- a/source4/smb_server/smb2/negprot.c
+++ b/source4/smb_server/smb2/negprot.c
@@ -97,14 +97,21 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
NTSTATUS status;
struct timeval current_time;
struct timeval boot_time;
+ uint16_t i;
+ uint16_t dialect = 0;
/* we only do one dialect for now */
if (io->in.dialect_count < 1) {
return NT_STATUS_NOT_SUPPORTED;
}
- if (io->in.dialects[0] != 0 &&
- io->in.dialects[0] != SMB2_DIALECT_REVISION) {
- DEBUG(0,("Got unexpected SMB2 dialect %u\n", io->in.dialects[0]));
+ for (i=0; i < io->in.dialect_count; i++) {
+ dialect = io->in.dialects[i];
+ if (dialect == SMB2_DIALECT_REVISION_202) {
+ break;
+ }
+ }
+ if (dialect != SMB2_DIALECT_REVISION_202) {
+ DEBUG(0,("Got unexpected SMB2 dialect %u\n", dialect));
return NT_STATUS_NOT_SUPPORTED;
}
@@ -128,7 +135,7 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
req->smb_conn->smb2_signing_required = true;
break;
}
- io->out.dialect_revision = SMB2_DIALECT_REVISION;
+ io->out.dialect_revision = dialect;
io->out.capabilities = 0;
io->out.max_transact_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL,
"smb2", "max transaction size", 0x10000);
@@ -281,7 +288,7 @@ void smb2srv_reply_smb_negprot(struct smbsrv_request *smb_req)
SSVAL(req->in.body, 0x02, 1);
memset(req->in.body+0x04, 0, 32);
- SSVAL(req->in.body, 0x24, 0);
+ SSVAL(req->in.body, 0x24, SMB2_DIALECT_REVISION_202);
smb2srv_negprot_recv(req);
return;