s3: smbd: In smbd_smb2_create_send() call the helper function check_path_syntax_smb2().
authorJeremy Allison <jra@samba.org>
Tue, 9 Aug 2022 17:39:41 +0000 (10:39 -0700)
committerStefan Metzmacher <metze@samba.org>
Tue, 16 Aug 2022 18:27:13 +0000 (18:27 +0000)
Previously for DFS names we were skipping this.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
(cherry picked from commit 4fafc3418931de06ea2d91baca1eef8d904cc4e6)

source3/smbd/smb2_create.c

index dbafaf015975525fb84e4605ea1c8d1e39f4a15a..8ef605dea66a67744e227453f6112c04655a3db9 100644 (file)
@@ -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(