From: Ralph Boehme Date: Fri, 11 Jul 2025 04:49:54 +0000 (+0200) Subject: smbd: add smbXsrv_tcon to smbXsrv_open X-Git-Tag: tdb-1.4.14~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f9409a80ac4acdccfef08b13cd59d0f5dc38f8f;p=thirdparty%2Fsamba.git smbd: add smbXsrv_tcon to smbXsrv_open Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl index a6d7075663e..a5b30493ed9 100644 --- a/source3/librpc/idl/smbXsrv.idl +++ b/source3/librpc/idl/smbXsrv.idl @@ -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; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 2c770e2a8b0..4cc203d8a1a 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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)) { diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 0b516f9b3fb..8412622e6cb 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -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, diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index f7e55f8b78d..99fe9a2b814 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -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); diff --git a/source3/smbd/smbXsrv_open.h b/source3/smbd/smbXsrv_open.h index 4f57363d615..72752967a78 100644 --- a/source3/smbd/smbXsrv_open.h +++ b/source3/smbd/smbXsrv_open.h @@ -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,