summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/smb2_lock.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index 23b9913478..c4a40a5128 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -235,6 +235,24 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
+ if (!isunlock && (in_lock_count > 1)) {
+
+ /*
+ * 3.3.5.14.2 says we SHOULD fail with INVALID_PARAMETER if we
+ * have more than one lock and one of those is blocking.
+ */
+
+ for (i=0; i<in_lock_count; i++) {
+ uint32_t flags = in_locks[i].flags;
+
+ if ((flags & SMB2_LOCK_FLAG_FAIL_IMMEDIATELY) == 0) {
+ tevent_req_nterror(
+ req, NT_STATUS_INVALID_PARAMETER);
+ return tevent_req_post(req, ev);
+ }
+ }
+ }
+
for (i=0; i<in_lock_count; i++) {
bool invalid = false;
@@ -245,11 +263,6 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
invalid = true;
break;
}
- if (i > 0) {
- tevent_req_nterror(req,
- NT_STATUS_INVALID_PARAMETER);
- return tevent_req_post(req, ev);
- }
break;
case SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_FAIL_IMMEDIATELY: