summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_generic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-11-26 16:35:03 +1100
committerAndrew Tridgell <tridge@samba.org>2009-11-27 16:05:05 +1100
commitaa4c51602383d50b0801d854e752b575c70f7657 (patch)
treef7245f4049912c18e37b2e71a1df7a508eb25ea4 /source4/ntvfs/ntvfs_generic.c
parent61a278fd8ab3feb26e6bc095d4f170fd97aa5c89 (diff)
downloadsamba-aa4c51602383d50b0801d854e752b575c70f7657.tar.gz
samba-aa4c51602383d50b0801d854e752b575c70f7657.tar.bz2
samba-aa4c51602383d50b0801d854e752b575c70f7657.zip
s4-smb2: check for an invalid lock flags combination
UNLOCK with FAIL_IMMEDIATELY is not allowed
Diffstat (limited to 'source4/ntvfs/ntvfs_generic.c')
-rw-r--r--source4/ntvfs/ntvfs_generic.c3
1 files changed, 3 insertions, 0 deletions
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 {