summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-08 06:57:45 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-09 08:21:35 +0200
commitb5a72f4f35a3aecba6294a3f8c07fb2ea252284b (patch)
tree4d5a8456c15fc43fcf5bd89e90b8e6404c41adf1
parentf15d9a66701eaf580a0b641cf3f0dec185d6dd48 (diff)
downloadsamba-b5a72f4f35a3aecba6294a3f8c07fb2ea252284b.tar.gz
samba-b5a72f4f35a3aecba6294a3f8c07fb2ea252284b.tar.bz2
samba-b5a72f4f35a3aecba6294a3f8c07fb2ea252284b.zip
s3:smb2_server: check the session before we could response with an error.
metze
-rw-r--r--source3/smbd/smb2_server.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 61c1bfffae..4849211e22 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1742,21 +1742,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
}
}
- call = smbd_smb2_call(opcode);
- if (call == NULL) {
- return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
- }
-
- 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);
- }
-
/*
* Check if the client provided a valid session id,
* if so smbd_smb2_request_check_session() calls
@@ -1777,6 +1762,21 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
}
}
+ call = smbd_smb2_call(opcode);
+ if (call == NULL) {
+ return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
+ }
+
+ 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);
+ }
+
req->do_signing = false;
if (flags & SMB2_HDR_FLAG_SIGNED) {
DATA_BLOB signing_key;