From aa4c51602383d50b0801d854e752b575c70f7657 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Nov 2009 16:35:03 +1100 Subject: s4-smb2: check for an invalid lock flags combination UNLOCK with FAIL_IMMEDIATELY is not allowed --- source4/ntvfs/ntvfs_generic.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 1d81acfd81..3319539b63 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -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 { -- cgit