[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-987-g168a7cb

Stefan Metzmacher metze at samba.org
Fri Aug 14 05:29:35 MDT 2009


The branch, master has been updated
       via  168a7cb6a893fb56ef9fe7a4dc99bbc117a75962 (commit)
       via  86ea1c4d24c80ada573fe6f91ea56c1bace2f906 (commit)
      from  53ef426e6f68728763436bd0cd3dd91180c00579 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 168a7cb6a893fb56ef9fe7a4dc99bbc117a75962
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 14 11:24:30 2009 +0200

    s3:smbd: allow SMB2 Cancel to have the async flag set
    
    metze

commit 86ea1c4d24c80ada573fe6f91ea56c1bace2f906
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 14 11:14:42 2009 +0200

    s3:smbd: fix parsing of the SMB2 body
    
    Maybe there's no dynamic part on the wire.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/smb2_server.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 1b22c82..edddccb 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -574,6 +574,7 @@ static NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
 	uint32_t flags;
 	NTSTATUS status;
 	NTSTATUS session_status;
+	uint32_t allowed_flags;
 
 	inhdr = (const uint8_t *)req->in.vector[i].iov_base;
 
@@ -583,14 +584,15 @@ static NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
 	opcode = IVAL(inhdr, SMB2_HDR_OPCODE);
 	DEBUG(10,("smbd_smb2_request_dispatch: opcode[%u]\n", opcode));
 
-#define TMP_SMB2_ALLOWED_FLAGS ( \
-	SMB2_HDR_FLAG_CHAINED | \
-	SMB2_HDR_FLAG_SIGNED | \
-	SMB2_HDR_FLAG_DFS)
-	if ((flags & ~TMP_SMB2_ALLOWED_FLAGS) != 0) {
+	allowed_flags = SMB2_HDR_FLAG_CHAINED |
+			SMB2_HDR_FLAG_SIGNED |
+			SMB2_HDR_FLAG_DFS;
+	if (opcode == SMB2_OP_CANCEL) {
+		allowed_flags |= SMB2_HDR_FLAG_ASYNC;
+	}
+	if ((flags & ~allowed_flags) != 0) {
 		return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
 	}
-#undef TMP_SMB2_ALLOWED_FLAGS
 
 	session_status = smbd_smb2_request_check_session(req);
 
@@ -1328,7 +1330,13 @@ static int smbd_smb2_request_next_vector(struct tstream_context *stream,
 				 * body and let the caller deal with the error
 				 */
 				invalid = true;
-			} else if (body_size > (full_size - SMB2_HDR_BODY)) {
+			}
+
+			if ((body_size % 2) != 0) {
+				body_size -= 1;
+			}
+
+			if (body_size > (full_size - SMB2_HDR_BODY)) {
 				/*
 				 * this is invalid, just return a zero
 				 * body and let the caller deal with the error
@@ -1342,10 +1350,6 @@ static int smbd_smb2_request_next_vector(struct tstream_context *stream,
 			body_size = 2;
 		}
 
-		if ((body_size % 2) != 0) {
-			body_size -= 1;
-		}
-
 		dyn_size = full_size - (SMB2_HDR_BODY + body_size);
 
 		state->missing -= (body_size - 2) + dyn_size;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list