s3:smbd: add fsp_set_base_fsp() helper
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Dec 2020 14:44:22 +0000 (15:44 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jan 2021 11:30:38 +0000 (11:30 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/files.c
source3/smbd/proto.h

index 1c26b775f53dc9fbdfb6375c5954bb0ea8217afb..42a631872eafd5c30acd9c68d70c5a7c91015136 100644 (file)
@@ -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;
+}
index 60e4877004b0ed39578e4faca8bca5873c3b3704..2e181a94e9198771ed3b542018d2c2794cf6dd1a 100644 (file)
@@ -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,