]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
scavenger: update cleanup_disconnected_share_mode_entry_fn() for Persistent Handles
authorRalph Boehme <slow@samba.org>
Thu, 20 Feb 2025 17:20:18 +0000 (18:20 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
Also don't panic if the disconnected check fails, just log it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/scavenger.c

index 674c3b9a4f2d5bfdab1222e310be87a5a81b9dc3..5600ac8806028995359e1ba28d14240534105b85 100644 (file)
@@ -477,7 +477,11 @@ static bool cleanup_disconnected_share_mode_entry_fn(
                return false;
        }
 
-       disconnected = server_id_is_disconnected(&e->pid);
+       if (e->flags & SHARE_ENTRY_FLAG_PERSISTENT_OPEN) {
+               disconnected = !serverid_exists(&e->pid);
+       } else {
+               disconnected = server_id_is_disconnected(&e->pid);
+       }
        if (!disconnected) {
                char *name = share_mode_filename(talloc_tos(), state->lck);
                struct file_id_buf tmp1;
@@ -489,7 +493,7 @@ static bool cleanup_disconnected_share_mode_entry_fn(
                        name,
                        server_id_str_buf(e->pid, &tmp2));
                TALLOC_FREE(name);
-               smb_panic(__location__);
+               return false;
        }
 
        /*