]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove SMB1 special case handling from brlock.c
authorVolker Lendecke <vl@samba.org>
Thu, 13 Jun 2019 10:46:01 +0000 (03:46 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 20 Jun 2019 17:18:19 +0000 (17:18 +0000)
This is now handled in smbd_smb1_do_locks_send/recv.

From here on for a few commits we won't survive make test.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/brlock.c

index 872a4b9869bb8da603bb27766281e2b3ac55f77f..16ed39abedad6e6e4142f4b10acf194eb1a12086 100644 (file)
@@ -309,40 +309,6 @@ static bool brl_pending_overlap(const struct lock_struct *lock,
        return false;
 }
 
-/****************************************************************************
- Amazingly enough, w2k3 "remembers" whether the last lock failure on a fnum
- is the same as this one and changes its error code. I wonder if any
- app depends on this ?
-****************************************************************************/
-
-static NTSTATUS brl_lock_failed(files_struct *fsp,
-                               const struct lock_struct *lock,
-                               bool blocking_lock)
-{
-       if (lock->start >= 0xEF000000 && (lock->start >> 63) == 0) {
-               /* amazing the little things you learn with a test
-                  suite. Locks beyond this offset (as a 64 bit
-                  number!) always generate the conflict error code,
-                  unless the top bit is set */
-               if (!blocking_lock) {
-                       fsp->last_lock_failure = *lock;
-               }
-               return NT_STATUS_FILE_LOCK_CONFLICT;
-       }
-
-       if (serverid_equal(&lock->context.pid, &fsp->last_lock_failure.context.pid) &&
-                       lock->context.tid == fsp->last_lock_failure.context.tid &&
-                       lock->fnum == fsp->last_lock_failure.fnum &&
-                       lock->start == fsp->last_lock_failure.start) {
-               return NT_STATUS_FILE_LOCK_CONFLICT;
-       }
-
-       if (!blocking_lock) {
-               fsp->last_lock_failure = *lock;
-       }
-       return NT_STATUS_LOCK_NOT_GRANTED;
-}
-
 /****************************************************************************
  Open up the brlock.tdb database.
 ****************************************************************************/
@@ -442,7 +408,7 @@ NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
                        }
                        /* Remember who blocked us. */
                        plock->context.smblctx = locks[i].context.smblctx;
-                       return brl_lock_failed(fsp,plock,blocking_lock);
+                       return NT_STATUS_LOCK_NOT_GRANTED;
                }
 #if ZERO_ZERO
                if (plock->start == 0 && plock->size == 0 &&