]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/brlock: map nt-error from correct errno-value master
authorShachar Sharon <ssharon@redhat.com>
Sun, 19 Apr 2026 13:07:11 +0000 (16:07 +0300)
committerMartin Schwenke <martins@samba.org>
Tue, 21 Apr 2026 02:05:57 +0000 (02:05 +0000)
The functions 'brl_lock_windows_default' and 'brl_lock_posix' uses
explicit 'errno_ret' value to avoid possible errno overwrite. Use in
failure case.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Shwetha Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Apr 21 02:05:57 UTC 2026 on atb-devel-224

source3/locking/brlock.c

index d1572c429a591c82002af5e33ca511d0db7d0297..207f3757989849953b0c8595a545a83b32d46197 100644 (file)
@@ -437,7 +437,7 @@ NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
                                status = NT_STATUS_LOCK_NOT_GRANTED;
                                goto fail;
                        } else {
                                status = NT_STATUS_LOCK_NOT_GRANTED;
                                goto fail;
                        } else {
-                               status = map_nt_error_from_unix(errno);
+                               status = map_nt_error_from_unix(errno_ret);
                                goto fail;
                        }
                }
                                goto fail;
                        }
                }
@@ -890,7 +890,7 @@ static NTSTATUS brl_lock_posix(struct byte_range_lock *br_lck,
                                goto fail;
                        } else {
                                TALLOC_FREE(tp);
                                goto fail;
                        } else {
                                TALLOC_FREE(tp);
-                               status = map_nt_error_from_unix(errno);
+                               status = map_nt_error_from_unix(errno_ret);
                                goto fail;
                        }
                }
                                goto fail;
                        }
                }