mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +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:
parent
31f5c714c6
commit
34fabc26f1
@ -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,
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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,15 +279,17 @@ 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
|
||||||
|
* when we add SMB3+POSIX parsing.
|
||||||
|
*/
|
||||||
return check_path_syntax(path);
|
return check_path_syntax(path);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
SMB2-only code to strip an MSDFS prefix from an incoming pathname.
|
SMB2-only code to strip an MSDFS prefix from an incoming pathname.
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user