s4-smb2: check for an invalid lock flags combination
authorAndrew Tridgell <tridge@samba.org>
Thu, 26 Nov 2009 05:35:03 +0000 (16:35 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 27 Nov 2009 05:05:05 +0000 (16:05 +1100)
UNLOCK with FAIL_IMMEDIATELY is not allowed

source4/ntvfs/ntvfs_generic.c

index 1d81acfd8112fee63f1ca7ae8137ce43b7868526..3319539b63d5361844aacbf4faff120bcfe6be62 100644 (file)
@@ -1106,6 +1106,9 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
                /* only the first lock gives the UNLOCK bit - see
                   MS-SMB2 3.3.5.14 */
                if (lck->smb2.in.locks[0].flags & SMB2_LOCK_FLAG_UNLOCK) {
+                       if (lck->smb2.in.locks[0].flags & SMB2_LOCK_FLAG_FAIL_IMMEDIATELY) {
+                               return NT_STATUS_INVALID_PARAMETER;
+                       }
                        lck2->generic.in.ulock_cnt = lck->smb2.in.lock_count;
                        isunlock = true;
                } else {