From 928382f27000ce93aa29080f06cb7445b0b8c281 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 21 Dec 2020 15:44:22 +0100 Subject: [PATCH] s3:smbd: add fsp_set_base_fsp() helper Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/smbd/files.c | 9 +++++++++ source3/smbd/proto.h | 1 + 2 files changed, 10 insertions(+) diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 1c26b775f53..42a631872ea 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -1319,3 +1319,12 @@ size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen) return len; } + +void fsp_set_base_fsp(struct files_struct *fsp, struct files_struct *base_fsp) +{ + if (base_fsp != NULL) { + SMB_ASSERT(base_fsp->base_fsp == NULL); + } + + fsp->base_fsp = base_fsp; +} diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 60e4877004b..2e181a94e91 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -446,6 +446,7 @@ NTSTATUS file_name_hash(connection_struct *conn, NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, const struct smb_filename *smb_fname_in); size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen); +void fsp_set_base_fsp(struct files_struct *fsp, struct files_struct *base_fsp); NTSTATUS create_internal_fsp(connection_struct *conn, const struct smb_filename *smb_fname, -- 2.34.1