]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add helper function check_path_syntax_smb2().
authorJeremy Allison <jra@samba.org>
Tue, 9 Aug 2022 17:36:00 +0000 (10:36 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 12 Aug 2022 18:19:30 +0000 (18:19 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/proto.h
source3/smbd/smb2_reply.c

index ceee52d79cd3d7ae1e3486328b95c3d05e21d6a0..33fc222311ebdc511fda80064c0378e6de3d4795 100644 (file)
@@ -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,
index 6052f94354a8d3a94f7ab684f094d5c679bb19eb..0303db428f255c5093fde5f56cde8b9d8c92ca79 100644 (file)
@@ -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.