summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-05-10 11:29:34 -0700
committerJeremy Allison <jra@samba.org>2010-05-10 11:29:34 -0700
commit0085a3bd2e60cc6c539259d8d83e97e852ef5e52 (patch)
tree6a512fd2cc49978d6483a1ca1a573b33b5604626 /source3/smbd
parenta9a3c83b413cf3f853845c9e9b6069ed3d7c1cde (diff)
downloadsamba-0085a3bd2e60cc6c539259d8d83e97e852ef5e52.tar.gz
samba-0085a3bd2e60cc6c539259d8d83e97e852ef5e52.tar.bz2
samba-0085a3bd2e60cc6c539259d8d83e97e852ef5e52.zip
Fix the processing of unlocks followed by locks. We now pass SMB2-LOCK test.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_lock.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index f9717796dd..8e66248790 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -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;