s3:smb2_server: do the req->next_status check before the signing checks
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Sep 2012 22:52:19 +0000 (00:52 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 29 Oct 2012 09:05:37 +0000 (10:05 +0100)
Windows 2012 returns NT_STATUS_INVALID_PARAMETER to
the smb2.compound.invalid1 test if that uses signing
(instead of NT_STATUS_ACCESS_DENIED).

metze
(similar to commit 4384485f82aac109bf4c4c31075e313e54b4c076)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ebabb40d1d423fab720735ac9225a09a8fc5feca)

source3/smbd/smb2_server.c

index dfd1d71f0cedb8c2a8d538491093667e630a91a7..6c110a4ab0105b67bd5d918abff0fe80e9087c6b 100644 (file)
@@ -1369,6 +1369,21 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
         */
        session_status = smbd_smb2_request_check_session(req);
 
+       if (flags & SMB2_HDR_FLAG_CHAINED) {
+               /*
+                * This check is mostly for giving the correct error code
+                * for compounded requests.
+                *
+                * TODO: we may need to move this after the session
+                *       and tcon checks.
+                */
+               if (!NT_STATUS_IS_OK(req->next_status)) {
+                       return smbd_smb2_request_error(req, req->next_status);
+               }
+       } else {
+               req->compat_chain_fsp = NULL;
+       }
+
        req->do_signing = false;
        if (flags & SMB2_HDR_FLAG_SIGNED) {
                if (!NT_STATUS_IS_OK(session_status)) {
@@ -1387,21 +1402,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_ACCESS_DENIED);
        }
 
-       if (flags & SMB2_HDR_FLAG_CHAINED) {
-               /*
-                * This check is mostly for giving the correct error code
-                * for compounded requests.
-                *
-                * TODO: we may need to move this after the session
-                *       and tcon checks.
-                */
-               if (!NT_STATUS_IS_OK(req->next_status)) {
-                       return smbd_smb2_request_error(req, req->next_status);
-               }
-       } else {
-               req->compat_chain_fsp = NULL;
-       }
-
        if (req->compound_related) {
                req->sconn->smb2.compound_related_in_progress = true;
        }