smbd: Move mask_match_search() to smb1_reply.c
authorVolker Lendecke <vl@samba.org>
Sun, 12 Nov 2023 10:48:30 +0000 (11:48 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 15 Nov 2023 05:10:35 +0000 (05:10 +0000)
Only called there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/proto.h
source3/lib/util.c
source3/smbd/smb1_reply.c

index 06ad7fb508a754784befb4e41437144cb8051cd6..13152f7a10afdfa41c4ed2d20d9e2f6b8a28c7f7 100644 (file)
@@ -347,7 +347,6 @@ bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
 bool ms_has_wild(const char *s);
 bool ms_has_wild_w(const smb_ucs2_t *s);
 bool mask_match(const char *string, const char *pattern, bool is_case_sensitive);
-bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive);
 bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive);
 #include "lib/util/unix_match.h"
 bool name_to_fqdn(fstring fqdn, const char *name);
index f891842a6b7823f55720abad86bc99560f39fc75..fa01f419d657fb945abeeb3a654ef7d9ab7f9bc8 100644 (file)
@@ -1481,22 +1481,6 @@ bool mask_match(const char *string, const char *pattern, bool is_case_sensitive)
        return ms_fnmatch_protocol(pattern, string, Protocol, is_case_sensitive) == 0;
 }
 
-/*******************************************************************
- A wrapper that handles case sensitivity and the special handling
- of the ".." name. Variant that is only called by old search code which requires
- pattern translation.
-*******************************************************************/
-
-bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive)
-{
-       if (ISDOTDOT(string))
-               string = ".";
-       if (ISDOT(pattern))
-               return False;
-
-       return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0;
-}
-
 /*******************************************************************
  A wrapper that handles a list of patterns and calls mask_match()
  on each.  Returns True if any of the patterns match.
index 52a06fed8214ce1fb9dd02df7a814d201bf8c6f3..ed6a17374858ab733ecfb7134ef4bd3d15f6c41c 100644 (file)
@@ -1125,6 +1125,25 @@ static void make_dir_struct(TALLOC_CTX *ctx,
        DEBUG(8,("put name [%s] from [%s] into dir struct\n",buf+30, fname));
 }
 
+/*******************************************************************
+ A wrapper that handles case sensitivity and the special handling
+ of the ".." name.
+*******************************************************************/
+
+static bool mask_match_search(const char *string,
+                             const char *pattern,
+                             bool is_case_sensitive)
+{
+       if (ISDOTDOT(string)) {
+               string = ".";
+       }
+       if (ISDOT(pattern)) {
+               return False;
+       }
+
+       return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0;
+}
+
 static bool mangle_mask_match(connection_struct *conn,
                              const char *filename,
                              const char *mask)