summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-12-04 14:04:08 -0800
committerJeremy Allison <jra@samba.org>2009-12-04 14:04:08 -0800
commit32915ceefc718621e2e9b17fee97da82744ab67a (patch)
tree1cc86482f9a9e0210e060b8c6343e3706e59fa67 /source3/locking
parent1d3942c534791e7767b64be383e6e035b164c506 (diff)
downloadsamba-32915ceefc718621e2e9b17fee97da82744ab67a.tar.gz
samba-32915ceefc718621e2e9b17fee97da82744ab67a.tar.bz2
samba-32915ceefc718621e2e9b17fee97da82744ab67a.zip
Make Samba3 pass the RAW-LOCK test as Windows.
Implement the win7 NT_STATUS_INVALID_LOCK_RANGE. Make smbd behave as Windows does in canceling locks. Jeremy.
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index b021293c7b..22c6c9e5b3 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -333,6 +333,11 @@ NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
SMB_ASSERT(plock->lock_type != UNLOCK_LOCK);
for (i=0; i < br_lck->num_locks; i++) {
+ if (locks[i].start + locks[i].size < locks[i].start) {
+ /* 64-bit wrap. Error. */
+ return NT_STATUS_INVALID_LOCK_RANGE;
+ }
+
/* Do any Windows or POSIX locks conflict ? */
if (brl_conflict(&locks[i], plock)) {
/* Remember who blocked us. */