From ea47abcf3c9e750fa6315ec1de0c18f9fb4faaeb Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 13 Jun 2016 16:12:54 +0200 Subject: smbd: Add fsp_fullbasepath Okay, this is similar to full_path_tos, but with variable arrays now and much simpler :-) Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/files.c | 11 +++++++++++ source3/smbd/proto.h | 1 + 2 files changed, 12 insertions(+) (limited to 'source3') diff --git a/source3/smbd/files.c b/source3/smbd/files.c index a3cce138e02..f211c17f5e9 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -780,3 +780,14 @@ uint32_t fsp_lease_type(struct files_struct *fsp) } return map_oplock_to_lease_type(fsp->oplock_type); } + +size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen) +{ + int len; + + len = snprintf(buf, buflen, "%s/%s", fsp->conn->connectpath, + fsp->fsp_name->base_name); + SMB_ASSERT(len>0); + + return len; +} diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 86fafe59107..764673cf7f2 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -412,6 +412,7 @@ NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, const struct smb_filename *smb_fname_in); const struct GUID *fsp_client_guid(const files_struct *fsp); uint32_t fsp_lease_type(struct files_struct *fsp); +size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen); /* The following definitions come from smbd/ipc.c */ -- cgit v1.2.1