1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2023-03-27 12:23:44 -07:00 committed by Ralph Boehme
parent 31f5c714c6
commit 34fabc26f1
4 changed files with 14 additions and 11 deletions

View File

@ -935,7 +935,7 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
NTSTATUS check_path_syntax(char *path); NTSTATUS check_path_syntax(char *path);
NTSTATUS check_path_syntax_posix(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); NTSTATUS smb2_strip_dfs_path(const char *in_path, const char **out_path);
size_t srvstr_get_path(TALLOC_CTX *ctx, size_t srvstr_get_path(TALLOC_CTX *ctx,
const char *inbuf, const char *inbuf,

View File

@ -511,7 +511,7 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(struct smb_request *smb1req
} }
/* This also converts '\' to '/' */ /* This also converts '\' to '/' */
status = check_path_syntax_smb2(filename, is_dfs); status = check_path_syntax_smb2(filename);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(filename); TALLOC_FREE(filename);
return status; return status;
@ -1041,7 +1041,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
} }
/* convert '\\' into '/' */ /* convert '\\' into '/' */
status = check_path_syntax_smb2(state->fname, is_dfs); status = check_path_syntax_smb2(state->fname);
if (tevent_req_nterror(req, status)) { if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, state->ev); return tevent_req_post(req, state->ev);
} }

View File

@ -243,6 +243,7 @@ NTSTATUS check_path_syntax_posix(char *path)
return check_path_syntax_internal(path, true); return check_path_syntax_internal(path, true);
} }
#if 0
/**************************************************************************** /****************************************************************************
Check the path for an SMB2 DFS path. Check the path for an SMB2 DFS path.
SMB2 DFS paths look like hostname\share (followed by a possible \extrapath. 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++ = '/'; *remaining_path++ = '/';
return check_path_syntax(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); * Now a simple wrapper around check_path_syntax().
} else { * Leave it alone for now to keep things separate
return check_path_syntax(path); * when we add SMB3+POSIX parsing.
} */
return check_path_syntax(path);
} }
/**************************************************************************** /****************************************************************************

View File

@ -4445,7 +4445,7 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
req->flags2 &= ~FLAGS2_DFS_PATHNAMES; req->flags2 &= ~FLAGS2_DFS_PATHNAMES;
ucf_flags &= ~UCF_DFS_PATHNAME; ucf_flags &= ~UCF_DFS_PATHNAME;
status = check_path_syntax_smb2(newname, false); status = check_path_syntax_smb2(newname);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
return status; return status;
} }
@ -4556,7 +4556,7 @@ static NTSTATUS smb2_file_link_information(connection_struct *conn,
req->flags2 &= ~FLAGS2_DFS_PATHNAMES; req->flags2 &= ~FLAGS2_DFS_PATHNAMES;
ucf_flags &= ~UCF_DFS_PATHNAME; ucf_flags &= ~UCF_DFS_PATHNAME;
status = check_path_syntax_smb2(newname, false); status = check_path_syntax_smb2(newname);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
return status; return status;
} }