From 34fabc26f1da160eba13e1af9c9eac9ae1373fd6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Mar 2023 12:23:44 -0700 Subject: [PATCH] s3: smbd: Remove 'is_dfs' parameter to check_path_syntax_smb2(). check_path_syntax_smb2() is now a simple wrapper around check_path_syntax(). Leave it alone for now to keep things separate when we add SMB3+POSIX parsing. check_path_syntax_smb2_msdfs() is now no longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/proto.h | 2 +- source3/smbd/smb2_create.c | 4 ++-- source3/smbd/smb2_reply.c | 15 +++++++++------ source3/smbd/smb2_trans2.c | 4 ++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 5637b02cbd5..4e61dc426d8 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -935,7 +935,7 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname, NTSTATUS check_path_syntax(char *path); NTSTATUS check_path_syntax_posix(char *path); -NTSTATUS check_path_syntax_smb2(char *path, bool dfs_path); +NTSTATUS check_path_syntax_smb2(char *path); NTSTATUS smb2_strip_dfs_path(const char *in_path, const char **out_path); size_t srvstr_get_path(TALLOC_CTX *ctx, const char *inbuf, diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 8e5667f2ebc..c17562e93e1 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -511,7 +511,7 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(struct smb_request *smb1req } /* This also converts '\' to '/' */ - status = check_path_syntax_smb2(filename, is_dfs); + status = check_path_syntax_smb2(filename); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(filename); return status; @@ -1041,7 +1041,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } /* convert '\\' into '/' */ - status = check_path_syntax_smb2(state->fname, is_dfs); + status = check_path_syntax_smb2(state->fname); if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index 7bd4b4a5a18..a2e7de1c806 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -243,6 +243,7 @@ NTSTATUS check_path_syntax_posix(char *path) return check_path_syntax_internal(path, true); } +#if 0 /**************************************************************************** Check the path for an SMB2 DFS path. SMB2 DFS paths look like hostname\share (followed by a possible \extrapath. @@ -278,14 +279,16 @@ static NTSTATUS check_path_syntax_smb2_msdfs(char *path) *remaining_path++ = '/'; return check_path_syntax(remaining_path); } +#endif -NTSTATUS check_path_syntax_smb2(char *path, bool dfs_path) +NTSTATUS check_path_syntax_smb2(char *path) { - if (dfs_path) { - return check_path_syntax_smb2_msdfs(path); - } else { - return check_path_syntax(path); - } + /* + * Now a simple wrapper around check_path_syntax(). + * Leave it alone for now to keep things separate + * when we add SMB3+POSIX parsing. + */ + return check_path_syntax(path); } /**************************************************************************** diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index e01c50c762d..2cd882bd889 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -4445,7 +4445,7 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn, req->flags2 &= ~FLAGS2_DFS_PATHNAMES; ucf_flags &= ~UCF_DFS_PATHNAME; - status = check_path_syntax_smb2(newname, false); + status = check_path_syntax_smb2(newname); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -4556,7 +4556,7 @@ static NTSTATUS smb2_file_link_information(connection_struct *conn, req->flags2 &= ~FLAGS2_DFS_PATHNAMES; ucf_flags &= ~UCF_DFS_PATHNAME; - status = check_path_syntax_smb2(newname, false); + status = check_path_syntax_smb2(newname); if (!NT_STATUS_IS_OK(status)) { return status; } -- 2.11.4.GIT