From 41c94b8b1f0ba312711b5b6c2ba2f27c696b445b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Jul 2019 08:56:49 -0700 Subject: [PATCH] s3: smbd: OpenDir() is merely a wrapper around open_dir_safely(). Preparatory work. Separate these out internal to source3/smbd/dir.c so I can give the internal and external uses separate destructor functions to allow all client requested directory enumeration to move to handle based functions. Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider --- source3/smbd/dir.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 2c59cb898ec..bf829e75286 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -85,6 +85,12 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn, static void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset); +static struct smb_Dir *open_dir_safely(TALLOC_CTX *ctx, + connection_struct *conn, + const struct smb_filename *smb_dname, + const char *wcard, + uint32_t attr); + #define INVALID_DPTR_KEY (-3) /**************************************************************************** @@ -334,7 +340,7 @@ static struct smb_Dir *open_dir_with_privilege(connection_struct *conn, goto out; } - dir_hnd = OpenDir(NULL, conn, smb_fname_cwd, wcard, attr); + dir_hnd = open_dir_safely(NULL, conn, smb_fname_cwd, wcard, attr); out: @@ -431,7 +437,7 @@ NTSTATUS dptr_create(connection_struct *conn, wcard, attr); } else { - dir_hnd = OpenDir(NULL, + dir_hnd = open_dir_safely(NULL, conn, smb_dname_cp, wcard, -- 2.47.3