From: Jeremy Allison Date: Tue, 9 Aug 2022 17:39:41 +0000 (-0700) Subject: s3: smbd: In smbd_smb2_create_send() call the helper function check_path_syntax_smb2(). X-Git-Tag: talloc-2.4.0~1466 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fafc3418931de06ea2d91baca1eef8d904cc4e6;p=thirdparty%2Fsamba.git s3: smbd: In smbd_smb2_create_send() call the helper function check_path_syntax_smb2(). Previously for DFS names we were skipping this. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index dbafaf01597..8ef605dea66 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -714,6 +714,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, struct files_struct *dirfsp = NULL; struct smb_filename *smb_fname = NULL; uint32_t ucf_flags; + bool is_dfs = false; req = tevent_req_create(mem_ctx, &state, struct smbd_smb2_create_state); @@ -959,18 +960,13 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, state->lease_ptr = NULL; } - /* - * For a DFS path the function parse_dfs_path() - * will do the path processing. - */ + is_dfs = (smb1req->flags2 & FLAGS2_DFS_PATHNAMES); - if (!(smb1req->flags2 & FLAGS2_DFS_PATHNAMES)) { - /* convert '\\' into '/' */ - status = check_path_syntax(state->fname); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); - return tevent_req_post(req, state->ev); - } + /* convert '\\' into '/' */ + status = check_path_syntax_smb2(state->fname, is_dfs); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return tevent_req_post(req, state->ev); } ucf_flags = filename_create_ucf_flags(