]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default: ensure e.pid is current in vfs_default_durable_reconnect_fn()
authorRalph Boehme <slow@samba.org>
Tue, 2 Dec 2025 19:14:20 +0000 (20:14 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:36 +0000 (10:18 +0000)
We need the uptodate value in e.pid when we make use of e later.

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

index 6ea5791002dedd2f380493915e03bf2f4876531a..0f1912ee4922ced3f8bda1e5a2343d0fc93ac8a5 100644 (file)
@@ -613,6 +613,7 @@ static void vfs_default_durable_reconnect_fn(struct share_mode_lock *lck,
        struct durable_reconnect_state rstate = { .op = state->op, .e = &e, };
        struct vfs_open_how how = { .flags = 0, };
        struct file_id file_id;
+       struct server_id old_pid;
        bool have_share_mode_entry = false;
        uint32_t dosmode;
        int ret;
@@ -709,11 +710,14 @@ static void vfs_default_durable_reconnect_fn(struct share_mode_lock *lck,
        state->op->compat = fsp;
        fsp->op = state->op;
 
+       old_pid = e.pid;
+       e.pid = messaging_server_id(fsp->conn->sconn->msg_ctx);
+
        ok = reset_share_mode_entry(
                lck,
-               e.pid,
+               old_pid,
                e.share_file_id,
-               messaging_server_id(fsp->conn->sconn->msg_ctx),
+               e.pid,
                state->smb1req->mid);
        if (!ok) {
                DBG_DEBUG("Could not set new share_mode_entry values\n");