summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2/negprot.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-14 12:03:11 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-14 12:03:11 +0100
commit02af3663a457ebc6aa30e79614e44fb16be8cadd (patch)
treec4497d370126fbf328df34e7a1257eac2c58f386 /source4/smb_server/smb2/negprot.c
parent21c0f266616e093cccbaf9378b3a915e56ba6079 (diff)
parentb640f475be9b0f83e7812a5c7756344c5891cba3 (diff)
downloadsamba-02af3663a457ebc6aa30e79614e44fb16be8cadd.tar.gz
samba-02af3663a457ebc6aa30e79614e44fb16be8cadd.tar.bz2
samba-02af3663a457ebc6aa30e79614e44fb16be8cadd.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
(This used to be commit 50697762fd28e2fc77142c5fea528b12d4cc0ebc)
Diffstat (limited to 'source4/smb_server/smb2/negprot.c')
-rw-r--r--source4/smb_server/smb2/negprot.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c
index 7c295c05ab..5bbd7f7d5e 100644
--- a/source4/smb_server/smb2/negprot.c
+++ b/source4/smb_server/smb2/negprot.c
@@ -93,12 +93,14 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
struct timeval current_time;
struct timeval boot_time;
- /* we only do dialect 0 for now */
+ /* we only do one dialect for now */
if (io->in.dialect_count < 1) {
return NT_STATUS_NOT_SUPPORTED;
}
- if (io->in.dialects[0] != 0) {
+ 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]));
+ return NT_STATUS_NOT_SUPPORTED;
}
req->smb_conn->negotiate.protocol = PROTOCOL_SMB2;
@@ -108,8 +110,7 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
ZERO_STRUCT(io->out);
io->out.security_mode = 0; /* no signing yet */
- /* choose the first dialect offered for now */
- io->out.dialect_revision = io->in.dialects[0];
+ io->out.dialect_revision = SMB2_DIALECT_REVISION;
io->out.capabilities = 0;
io->out.max_transact_size = 0x10000;
io->out.max_read_size = 0x10000;
@@ -238,6 +239,8 @@ void smb2srv_reply_smb_negprot(struct smbsrv_request *smb_req)
req->in.body_size = body_fixed_size;
req->in.dynamic = NULL;
+ smb2srv_setup_bufinfo(req);
+
SIVAL(req->in.hdr, 0, SMB2_MAGIC);
SSVAL(req->in.hdr, SMB2_HDR_LENGTH, SMB2_HDR_BODY);
SSVAL(req->in.hdr, SMB2_HDR_EPOCH, 0);