From b922f6e7045fc7906ea60cd715b156ff61d477e2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Jul 2019 13:20:08 -0700 Subject: [PATCH] s3: smbd: Add dptr_fetch_lanman2_fsp() - to replace dptr_fetch_lanman2(). Not yet used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/dir.c | 15 +++++++++++++++ source3/smbd/proto.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 478ba5a9835..d6512b87663 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -837,6 +837,21 @@ struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn, return(dptr); } +/**************************************************************************** + Fetch the fsp associated with the dptr_num. +****************************************************************************/ + +files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn, + int dptr_num) +{ + struct dptr_struct *dptr = dptr_fetch_lanman2(sconn, dptr_num); + + if (dptr == NULL) { + return NULL; + } + return dptr->dir_hnd->fsp; +} + static bool mangle_mask_match(connection_struct *conn, const char *filename, const char *mask) diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 9b087fa6c94..d371ba9e4dc 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -211,6 +211,8 @@ files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn, char *buf,int *num); struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn, int dptr_num); +files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn, + int dptr_num); bool get_dir_entry(TALLOC_CTX *ctx, struct dptr_struct *dirptr, const char *mask, -- 2.47.3