summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-14 11:24:30 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-14 13:27:50 +0200
commit168a7cb6a893fb56ef9fe7a4dc99bbc117a75962 (patch)
tree2e1eea7271c5179ce848015bc900974f2ef25b96
parent86ea1c4d24c80ada573fe6f91ea56c1bace2f906 (diff)
downloadsamba-168a7cb6a893fb56ef9fe7a4dc99bbc117a75962.tar.gz
samba-168a7cb6a893fb56ef9fe7a4dc99bbc117a75962.tar.bz2
samba-168a7cb6a893fb56ef9fe7a4dc99bbc117a75962.zip
s3:smbd: allow SMB2 Cancel to have the async flag set
metze
-rw-r--r--source3/smbd/smb2_server.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index f4605ddde9..edddccb9d9 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);