lib/util Rename ms_fnmatch() to ms_fnmatch_protocol() to avoid dup symbol
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 May 2011 10:53:33 +0000 (20:53 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 4 May 2011 10:53:33 +0000 (20:53 +1000)
This verison of the function takes a protcol as argument to determine
matching rules.

Andrew Bartlett

lib/util/ms_fnmatch.c
lib/util/util.h
source4/client/client.c
source4/ntvfs/cifs_posix_cli/svfs_util.c
source4/ntvfs/posix/pvfs_dirlist.c
source4/ntvfs/simple/svfs_util.c
source4/torture/masktest.c

index 73fb0e09668dc90e9e6236c36c702c66222d3305..d029fd6b00e5c592c6849375fd07d61193704f4c 100644 (file)
@@ -154,7 +154,7 @@ static int ms_fnmatch_core(const char *p, const char *n,
        return -1;
 }
 
-int ms_fnmatch(const char *pattern, const char *string, enum protocol_types protocol)
+int ms_fnmatch_protocol(const char *pattern, const char *string, enum protocol_types protocol)
 {
        int ret, count, i;
        struct max_n *max_n = NULL;
@@ -192,7 +192,7 @@ int ms_fnmatch(const char *pattern, const char *string, enum protocol_types prot
                                p[i] = '<';
                        }
                }
-               ret = ms_fnmatch(p, string, PROTOCOL_NT1);
+               ret = ms_fnmatch_protocol(p, string, PROTOCOL_NT1);
                talloc_free(p);
                return ret;
        }
@@ -217,5 +217,5 @@ int ms_fnmatch(const char *pattern, const char *string, enum protocol_types prot
 /** a generic fnmatch function - uses for non-CIFS pattern matching */
 int gen_fnmatch(const char *pattern, const char *string)
 {
-       return ms_fnmatch(pattern, string, PROTOCOL_NT1);
+       return ms_fnmatch_protocol(pattern, string, PROTOCOL_NT1);
 }
index 45f1b9cd79eca9c4779d3dbbd536a7d108fd7caf..5ea011938764fbdaa20c1c8d74a4b4bd57cc40dc 100644 (file)
@@ -789,11 +789,12 @@ enum protocol_types {
        PROTOCOL_SMB2
 };
 
-int ms_fnmatch(const char *pattern, const char *string, enum protocol_types protocol);
+#endif
+
+int ms_fnmatch_protocol(const char *pattern, const char *string, enum protocol_types protocol);
 
 /** a generic fnmatch function - uses for non-CIFS pattern matching */
 int gen_fnmatch(const char *pattern, const char *string);
-#endif
 
 /* The following definitions come from lib/util/idtree.c  */
 
index 923a6f3a2381afe27b28ba100e783cefd2d8abc0..8fe4539150dac115bc93c5d6c8f872d3d69bafb4 100644 (file)
@@ -309,12 +309,12 @@ static bool mask_match(struct smbcli_state *c, const char *string,
                return false;
        
        if (is_case_sensitive)
-               return ms_fnmatch(pattern, string, 
+               return ms_fnmatch_protocol(pattern, string, 
                                  c->transport->negotiate.protocol) == 0;
 
        p2 = strlower_talloc(NULL, pattern);
        s2 = strlower_talloc(NULL, string);
-       ret = ms_fnmatch(p2, s2, c->transport->negotiate.protocol) == 0;
+       ret = ms_fnmatch_protocol(p2, s2, c->transport->negotiate.protocol) == 0;
        talloc_free(p2);
        talloc_free(s2);
 
index 128440c1ea8c7b04f697f135cfc1a6afe1e14490..f351c5840eadc536e50cd8e0ad239ce3db1e4d3c 100644 (file)
@@ -104,7 +104,7 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request
                if (!low_name) { continue; }
 
                /* check it matches the wildcard pattern */
-               if (ms_fnmatch(low_mask, low_name, PROTOCOL_NT1) != 0) {
+               if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) {
                        continue;
                }
                
index 77f19c358503809f56c085bca9020aefcb2defd1..1bc91c1c788fa5f7e6081c9d3eb4e287780b41f2 100644 (file)
@@ -199,7 +199,7 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
        if (*ofs == DIR_OFFSET_DOT) {
                (*ofs) = DIR_OFFSET_DOTDOT;
                dir->offset = *ofs;
-               if (ms_fnmatch(dir->pattern, ".", protocol) == 0) {
+               if (ms_fnmatch_protocol(dir->pattern, ".", protocol) == 0) {
                        dcache_add(dir, ".");
                        return ".";
                }
@@ -208,7 +208,7 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
        if (*ofs == DIR_OFFSET_DOTDOT) {
                (*ofs) = DIR_OFFSET_BASE;
                dir->offset = *ofs;
-               if (ms_fnmatch(dir->pattern, "..", protocol) == 0) {
+               if (ms_fnmatch_protocol(dir->pattern, "..", protocol) == 0) {
                        dcache_add(dir, "..");
                        return "..";
                }
@@ -228,10 +228,10 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
                        continue;
                }
 
-               if (ms_fnmatch(dir->pattern, dname, protocol) != 0) {
+               if (ms_fnmatch_protocol(dir->pattern, dname, protocol) != 0) {
                        char *short_name = pvfs_short_name_component(dir->pvfs, dname);
                        if (short_name == NULL ||
-                           ms_fnmatch(dir->pattern, short_name, protocol) != 0) {
+                           ms_fnmatch_protocol(dir->pattern, short_name, protocol) != 0) {
                                talloc_free(short_name);
                                continue;
                        }
index 75261f727707e2219a68f02b4f770d3398bfceb2..c4e015668c76ba7bf41e566eddec05aa8bab2323 100644 (file)
@@ -101,7 +101,7 @@ struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request *req,
                if (!low_name) { continue; }
 
                /* check it matches the wildcard pattern */
-               if (ms_fnmatch(low_mask, low_name, PROTOCOL_NT1) != 0) {
+               if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) {
                        continue;
                }
                
index bfd1aff5e8ab46ca5a883d8579bd75afc36170ef..e8f0aab94e71a4b69b1f744ebcef246c7b82b0a1 100644 (file)
@@ -49,7 +49,7 @@ static bool reg_match_one(struct smbcli_state *cli, const char *pattern, const c
 
        if (ISDOTDOT(file)) file = ".";
 
-       return ms_fnmatch(pattern, file, cli->transport->negotiate.protocol)==0;
+       return ms_fnmatch_protocol(pattern, file, cli->transport->negotiate.protocol)==0;
 }
 
 static char *reg_test(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *pattern, const char *long_name, const char *short_name)