]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: add smbXsrv_tcon to smbXsrv_open
authorRalph Boehme <slow@samba.org>
Fri, 11 Jul 2025 04:49:54 +0000 (06:49 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Aug 2025 14:52:34 +0000 (14:52 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/librpc/idl/smbXsrv.idl
source3/smbd/files.c
source3/smbd/smb2_create.c
source3/smbd/smbXsrv_open.c
source3/smbd/smbXsrv_open.h

index a6d7075663e4781ef2bf81fb0cc571d397abbbec..a5b30493ed9153c3fb6217d2fe290f67e4fad5c8 100644 (file)
@@ -475,6 +475,7 @@ interface smbXsrv
                uint32                                  local_id;
                [ref] smbXsrv_open_global0              *global;
                smbXsrv_session                         *session;
+               smbXsrv_tcon                            *tcon;
                NTSTATUS                                status;
                NTTIME                                  idle_time;
                [ignore] files_struct                   *compat;
index 2c770e2a8b0d27af05a04a557d07af3bc75e060f..4cc203d8a1aa2f5c5cf7d8869e57d8ba12538d48 100644 (file)
@@ -121,6 +121,7 @@ NTSTATUS fsp_bind_smb(struct files_struct *fsp, struct smb_request *req)
 
        status = smbXsrv_open_create(req->xconn,
                                     req->session,
+                                    fsp->conn->tcon,
                                     now,
                                     &op);
        if (!NT_STATUS_IS_OK(status)) {
index 0b516f9b3fb47e83be039bf30f4eb1e74bfd8b91..8412622e6cbbc127decfe9ad09171d5eb2b3bbff 100644 (file)
@@ -1103,6 +1103,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                }
                status = smb2srv_open_recreate(smb2req->xconn,
                                               smb2req->session,
+                                              smb2req->tcon,
                                               state->persistent_id,
                                               state->create_guid,
                                               lease_key,
index f7e55f8b78d3d7a6d23097fc91f5ffe8258d4a45..99fe9a2b814880d04832c782d0ef239162f61773 100644 (file)
@@ -566,6 +566,7 @@ static int smbXsrv_open_destructor(struct smbXsrv_open *op)
 
 NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn,
                             struct smbXsrv_session *session,
+                            struct smbXsrv_tcon *tcon,
                             NTTIME now,
                             struct smbXsrv_open **_open)
 {
@@ -602,6 +603,7 @@ NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn,
        op->status = NT_STATUS_OK; /* TODO: start with INTERNAL_ERROR */
        op->idle_time = now;
        op->session = session;
+       op->tcon = tcon;
 
        global = talloc_zero(op, struct smbXsrv_open_global0);
        if (global == NULL) {
@@ -1322,6 +1324,7 @@ not_found:
 
 NTSTATUS smb2srv_open_recreate(struct smbXsrv_connection *conn,
                               struct smbXsrv_session *session,
+                              struct smbXsrv_tcon *tcon,
                               uint64_t persistent_id,
                               const struct GUID *create_guid,
                               const struct smb2_lease_key *lease_key,
@@ -1407,6 +1410,7 @@ NTSTATUS smb2srv_open_recreate(struct smbXsrv_connection *conn,
        }
 
        state.op->session = session;
+       state.op->tcon = tcon;
 
        talloc_set_destructor(state.op, smbXsrv_open_destructor);
 
index 4f57363d6158f566899a027b376f3a41b1aa4e14..72752967a7877c0aac6debf1cef0bd76d1091185 100644 (file)
@@ -36,6 +36,7 @@ struct smbXsrv_client;
 NTSTATUS smbXsrv_open_global_init(void);
 NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn,
                             struct smbXsrv_session *session,
+                            struct smbXsrv_tcon *tcon,
                             NTTIME now,
                             struct smbXsrv_open **_open);
 NTSTATUS smbXsrv_open_update(struct smbXsrv_open *_open);
@@ -60,6 +61,7 @@ NTSTATUS smb2srv_open_lookup_replay_cache(struct smbXsrv_connection *conn,
 struct smb2_lease_key;
 NTSTATUS smb2srv_open_recreate(struct smbXsrv_connection *conn,
                               struct smbXsrv_session *session,
+                              struct smbXsrv_tcon *tcon,
                               uint64_t persistent_id,
                               const struct GUID *create_guid,
                               const struct smb2_lease_key *lease_key,