]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smb2_server: check the session before we could response with an error.
authorStefan Metzmacher <metze@samba.org>
Wed, 8 Aug 2012 04:57:45 +0000 (06:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 9 Aug 2012 06:21:35 +0000 (08:21 +0200)
metze

source3/smbd/smb2_server.c

index 61c1bfffae3bbd40451ee75f08a7a90b9a4c32d0..4849211e221181d2b34546df2719cf60cdd90eaa 100644 (file)
@@ -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;