summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-06-03 09:36:02 +1000
committerAndrew Tridgell <tridge@samba.org>2008-06-03 09:36:02 +1000
commit538f624fe02b9420fe44a5c32e0d0fcf6fcf1359 (patch)
tree6877035cb0c03d45f6e1916015caf90b0b672131 /source4
parent405e64c437348bc9e3f7d4412a55e5cf05b3890d (diff)
downloadsamba-538f624fe02b9420fe44a5c32e0d0fcf6fcf1359.tar.gz
samba-538f624fe02b9420fe44a5c32e0d0fcf6fcf1359.tar.bz2
samba-538f624fe02b9420fe44a5c32e0d0fcf6fcf1359.zip
it is not valid to set a UNLOCK flag on a lock request
(This used to be commit 63f315572969e7fc52bdc7c0b38eaaee736d5e2a)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/ntvfs_generic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index a3a8fcb1f4..4f3a7e2198 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -1067,9 +1067,13 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
(SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE))) {
return NT_STATUS_INVALID_PARAMETER;
}
- lck2->generic.in.locks[i].pid = req->smbpid;
+ if (!isunlock &&
+ (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ lck2->generic.in.locks[i].pid = req->smbpid;
lck2->generic.in.locks[i].offset = lck->smb2.in.locks[i].offset;
- lck2->generic.in.locks[i].count = lck->smb2.in.locks[i].length;
+ lck2->generic.in.locks[i].count = lck->smb2.in.locks[i].length;
if (!(lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_EXCLUSIVE)) {
lck2->generic.in.mode = LOCKING_ANDX_SHARED_LOCK;
}