]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix the processing of unlocks followed by locks. We now pass SMB2-LOCK test.
authorJeremy Allison <jra@samba.org>
Mon, 10 May 2010 18:29:34 +0000 (11:29 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 10 May 2010 18:29:34 +0000 (11:29 -0700)
Jeremy.

source3/smbd/smb2_lock.c

index f9717796dd1f572dc859fd9c7fe72bde6033607c..8e6624879055c2fb9c93eb63c42da5fb99933682 100644 (file)
@@ -298,12 +298,11 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                switch (in_locks[i].flags) {
                case SMB2_LOCK_FLAG_SHARED:
                case SMB2_LOCK_FLAG_EXCLUSIVE:
-                       if (i > 0) {
-                               tevent_req_nterror(req,
-                                                  NT_STATUS_INVALID_PARAMETER);
-                               return tevent_req_post(req, ev);
-                       }
                        if (isunlock) {
+                               invalid = true;
+                               break;
+                       }
+                       if (i > 0) {
                                tevent_req_nterror(req,
                                                   NT_STATUS_INVALID_PARAMETER);
                                return tevent_req_post(req, ev);
@@ -313,9 +312,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                case SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_FAIL_IMMEDIATELY:
                case SMB2_LOCK_FLAG_EXCLUSIVE|SMB2_LOCK_FLAG_FAIL_IMMEDIATELY:
                        if (isunlock) {
-                               tevent_req_nterror(req,
-                                                  NT_STATUS_INVALID_PARAMETER);
-                               return tevent_req_post(req, ev);
+                               invalid = true;
                        }
                        break;
 
@@ -369,7 +366,6 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                        (unsigned long long)locks[i].count,
                        (unsigned long long)locks[i].smblctx,
                        (int)locks[i].brltype ));
-
        }
 
        state->locks = locks;