]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:brlock: always return LOCK_NOT_GRANTED instead of FILE_LOCK_CONFLICT
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Aug 2019 10:33:28 +0000 (12:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 9 Sep 2019 14:23:40 +0000 (14:23 +0000)
Returning NT_STATUS_FILE_LOCK_CONFLICT is a SMB1 only detail
for delayed brlock requests, which is handled in
smbd_smb1_do_locks*().

The brlock layer should be consistent even for posix locks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
source3/locking/brlock.c

index 628c2574357dbca02811951d65fd75651f585a15..0a85bd0b057b5e749146d536570fb73c79bebb9f 100644 (file)
@@ -462,7 +462,7 @@ NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
                        plock->context.smblctx = 0xFFFFFFFFFFFFFFFFLL;
 
                        if (errno_ret == EACCES || errno_ret == EAGAIN) {
-                               status = NT_STATUS_FILE_LOCK_CONFLICT;
+                               status = NT_STATUS_LOCK_NOT_GRANTED;
                                goto fail;
                        } else {
                                status = map_nt_error_from_unix(errno);
@@ -829,7 +829,7 @@ static NTSTATUS brl_lock_posix(struct byte_range_lock *br_lck,
                                TALLOC_FREE(tp);
                                /* Remember who blocked us. */
                                plock->context.smblctx = curr_lock->context.smblctx;
-                               return NT_STATUS_FILE_LOCK_CONFLICT;
+                               return NT_STATUS_LOCK_NOT_GRANTED;
                        }
                        /* Just copy the Windows lock into the new array. */
                        memcpy(&tp[count], curr_lock, sizeof(struct lock_struct));
@@ -849,7 +849,7 @@ static NTSTATUS brl_lock_posix(struct byte_range_lock *br_lck,
                                TALLOC_FREE(tp);
                                /* Remember who blocked us. */
                                plock->context.smblctx = curr_lock->context.smblctx;
-                               return NT_STATUS_FILE_LOCK_CONFLICT;
+                               return NT_STATUS_LOCK_NOT_GRANTED;
                        }
 
                        /* Work out overlaps. */
@@ -912,7 +912,7 @@ static NTSTATUS brl_lock_posix(struct byte_range_lock *br_lck,
 
                        if (errno_ret == EACCES || errno_ret == EAGAIN) {
                                TALLOC_FREE(tp);
-                               status = NT_STATUS_FILE_LOCK_CONFLICT;
+                               status = NT_STATUS_LOCK_NOT_GRANTED;
                                goto fail;
                        } else {
                                TALLOC_FREE(tp);