]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:locking: let reset_share_mode_entry() report errors to the caller
authorStefan Metzmacher <metze@samba.org>
Sat, 10 Sep 2022 18:39:37 +0000 (20:39 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:34 +0000 (00:34 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15166

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/share_mode_lock.c

index 794d5015dc0f02ea85002e61d9cd9691925d8b5e..770da3ba8302e790316c0a7b51e0cbbd35036cbd 100644 (file)
@@ -2453,6 +2453,7 @@ bool reset_share_mode_entry(
        struct share_mode_entry e;
        struct share_mode_entry_buf e_buf;
        NTSTATUS status;
+       int cmp;
        bool ret = false;
        bool ok;
 
@@ -2474,9 +2475,9 @@ bool reset_share_mode_entry(
                goto done;
        }
 
-       ret = share_mode_entry_cmp(
+       cmp = share_mode_entry_cmp(
                old_pid, old_share_file_id, e.pid, e.share_file_id);
-       if (ret != 0) {
+       if (cmp != 0) {
                struct server_id_buf tmp1, tmp2;
                DBG_WARNING("Expected pid=%s, file_id=%"PRIu64", "
                            "got pid=%s, file_id=%"PRIu64"\n",
@@ -2512,5 +2513,5 @@ bool reset_share_mode_entry(
        ret = true;
 done:
        TALLOC_FREE(ltdb);
-       return true;
+       return ret;
 }