s3:smb2_server: keep compound_related on struct smbd_smb2_request
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Aug 2011 21:33:41 +0000 (23:33 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 16 Sep 2011 18:43:07 +0000 (20:43 +0200)
metze
(cherry picked from commit 0d450d166bab952daf37d922e5c2e5cac16f1cc3)

The last 3 patches address bug #8407 (SMB2 server can return requests
out-of-order when processing a compound request).
(cherry picked from commit 151bea2cc30f5a3e3cfaafd9e080f0d510f9563e)

source3/smbd/globals.h
source3/smbd/smb2_server.c

index e39ea3e5242ec77ff2e32ec9d800d53c048ee533..abeaed41d43a2261c26f4565be0f13ab7d623407 100644 (file)
@@ -358,6 +358,7 @@ struct smbd_smb2_request {
        bool do_signing;
        bool async;
        bool cancelled;
+       bool compound_related;
 
        /* fake smb1 request. */
        struct smb_request *smb1req;
index 5661c47bcbfe0cbd3ccc49ad6e607ec70a7bfb2e..d7a40ed16ecef5c438a889af644ed78173db5948 100644 (file)
@@ -357,7 +357,6 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
 {
        int count;
        int idx;
-       bool compound_related = false;
 
        count = req->in.vector_count;
 
@@ -405,7 +404,7 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
                         * compounded requests
                         */
                        if (flags & SMB2_HDR_FLAG_CHAINED) {
-                               compound_related = true;
+                               req->compound_related = true;
                        }
                } else if (idx > 4) {
 #if 0
@@ -418,13 +417,13 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
                         * all other requests should match the 2nd one
                         */
                        if (flags & SMB2_HDR_FLAG_CHAINED) {
-                               if (!compound_related) {
+                               if (!req->compound_related) {
                                        req->next_status =
                                                NT_STATUS_INVALID_PARAMETER;
                                        return NT_STATUS_OK;
                                }
                        } else {
-                               if (compound_related) {
+                               if (req->compound_related) {
                                        req->next_status =
                                                NT_STATUS_INVALID_PARAMETER;
                                        return NT_STATUS_OK;