From 7bd7fa0a0b46ad6826097a1987595e2ab6f83384 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Aug 2022 10:36:00 -0700 Subject: [PATCH] s3: smbd: Add helper function check_path_syntax_smb2(). Not yet used, but uses check_path_syntax_smb2_msdfs() so remove the #ifdef's around that. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/proto.h | 1 + source3/smbd/smb2_reply.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index ceee52d79cd..33fc222311e 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -941,6 +941,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); size_t srvstr_get_path(TALLOC_CTX *ctx, const char *inbuf, uint16_t smb_flags2, diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index 6052f94354a..0303db428f2 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -243,7 +243,6 @@ 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. @@ -279,7 +278,15 @@ 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) +{ + if (dfs_path) { + return check_path_syntax_smb2_msdfs(path); + } else { + return check_path_syntax(path); + } +} /**************************************************************************** Pull a string and check the path allowing a wildcard - provide for error return. -- 2.11.4.GIT