From 332338173ec9df9628e29eef2eccff2226c01e9d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Jul 2022 16:21:52 -0700 Subject: [PATCH] s3: smbd: Convert reply_checkpath() to use filename_convert_dirfsp(). One less use of filename_convert(). This is the acid test of filename_convert_dirfsp() pathname error handling. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Thu Jul 28 16:34:54 UTC 2022 on sn-devel-184 --- source3/smbd/smb1_reply.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index e2e164573e3..de38817ea76 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -561,7 +561,9 @@ void reply_checkpath(struct smb_request *req) struct smb_filename *smb_fname = NULL; char *name = NULL; NTSTATUS status; + struct files_struct *dirfsp = NULL; uint32_t ucf_flags = ucf_flags_from_smb_request(req); + NTTIME twrp = 0; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBcheckpath); @@ -578,13 +580,16 @@ void reply_checkpath(struct smb_request *req) DEBUG(3,("reply_checkpath %s mode=%d\n", name, (int)SVAL(req->vwv+0, 0))); - status = filename_convert(ctx, - conn, - name, - ucf_flags, - 0, - &smb_fname); - + if (ucf_flags & UCF_GMT_PATHNAME) { + extract_snapshot_token(name, &twrp); + } + status = filename_convert_dirfsp(ctx, + conn, + name, + ucf_flags, + twrp, + &dirfsp, + &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { reply_botherror(req, NT_STATUS_PATH_NOT_COVERED, -- 2.47.3