diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-05-27 16:02:10 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-05-27 16:02:10 +1000 |
commit | 848e7c5830a869d86d7fe236acc1e6a1949252d3 (patch) | |
tree | 7e48ada74c11171987fc000bea313dbe6d5467ed | |
parent | cf274201b4e987faa822a137bb67fa191dabc5e8 (diff) | |
download | samba-848e7c5830a869d86d7fe236acc1e6a1949252d3.tar.gz samba-848e7c5830a869d86d7fe236acc1e6a1949252d3.tar.bz2 samba-848e7c5830a869d86d7fe236acc1e6a1949252d3.zip |
it seems that lock flags are only validated when UNLOCK is set
(This used to be commit d1bde5830cd56042236d72598e5cfe9c7abc4c47)
-rw-r--r-- | source4/ntvfs/ntvfs_generic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index c5b88da3d1..e449e61b34 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -1044,11 +1044,12 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs, return NT_STATUS_NO_MEMORY; } for (i=0;i<lck->smb2.in.lock_count;i++) { - if (lck->smb2.in.locks[i].flags & ~SMB2_LOCK_FLAG_ALL_MASK) { - return NT_STATUS_INVALID_PARAMETER; - } if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK) { int j = lck2->generic.in.ulock_cnt; + if (lck->smb2.in.locks[i].flags & + (SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE)) { + return NT_STATUS_INVALID_PARAMETER; + } lck2->generic.in.ulock_cnt++; lck2->generic.in.locks[j].pid = 0; lck2->generic.in.locks[j].offset = lck->smb2.in.locks[i].offset; |