Revert "s3: Make the implicit reference to Protocol in mask_match() explicit"
authorVolker Lendecke <vl@samba.org>
Mon, 23 Nov 2009 15:34:07 +0000 (16:34 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 23 Nov 2009 15:35:00 +0000 (16:35 +0100)
This reverts commit e23d8a3d1f558a7e98ef2afd71e1d15c5b3a71bc.

source3/client/client.c
source3/include/proto.h
source3/lib/util.c
source3/smbd/reply.c
source3/smbd/trans2.c

index 7cbaa81..6773e6d 100644 (file)
@@ -472,8 +472,7 @@ static bool do_this_one(file_info *finfo)
        }
 
        if (*client_get_fileselection() &&
-           !mask_match(finfo->name, client_get_fileselection(),
-                       get_Protocol(), false)) {
+           !mask_match(finfo->name,client_get_fileselection(),false)) {
                DEBUG(3,("mask_match %s failed\n", finfo->name));
                return false;
        }
index 55466f3..88f6dd5 100644 (file)
@@ -1186,8 +1186,7 @@ bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
                    const char **name);
 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,
-               enum protocol_types proto, bool is_case_sensitive);
+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);
 bool unix_wild_match(const char *pattern, const char *string);
index e3ceea4..e0b09c4 100644 (file)
@@ -1687,8 +1687,7 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit
 
        for(; namelist->name != NULL; namelist++) {
                if(namelist->is_wild) {
-                       if (mask_match(last_component, namelist->name,
-                                      get_Protocol(), case_sensitive)) {
+                       if (mask_match(last_component, namelist->name, case_sensitive)) {
                                DEBUG(8,("is_in_path: mask match succeeded\n"));
                                return True;
                        }
@@ -2385,16 +2384,14 @@ bool ms_has_wild_w(const smb_ucs2_t *s)
  of the ".." name.
 *******************************************************************/
 
-bool mask_match(const char *string, const char *pattern,
-               enum protocol_types proto, bool is_case_sensitive)
+bool mask_match(const char *string, const char *pattern, bool is_case_sensitive)
 {
        if (ISDOTDOT(string))
                string = ".";
        if (ISDOT(pattern))
                return False;
 
-       return ms_fnmatch(pattern, string, proto <= PROTOCOL_LANMAN2,
-                         is_case_sensitive) == 0;
+       return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0;
 }
 
 /*******************************************************************
@@ -2421,8 +2418,7 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen
 bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive)
 {
        while (listLen-- > 0) {
-               if (mask_match(string, *list++, get_Protocol(),
-                             is_case_sensitive))
+               if (mask_match(string, *list++, is_case_sensitive))
                        return True;
        }
        return False;
index a113a9d..682f56f 100644 (file)
@@ -2638,7 +2638,7 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
                                continue;
                        }
 
-                       if(!mask_match(dname, fname_mask, get_Protocol(),
+                       if(!mask_match(dname, fname_mask,
                                       conn->case_sensitive)) {
                                TALLOC_FREE(frame);
                                TALLOC_FREE(talloced);
@@ -6337,8 +6337,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
                        continue;
                }
 
-               if(!mask_match(dname, fname_src_mask, get_Protocol(),
-                              conn->case_sensitive)) {
+               if(!mask_match(dname, fname_src_mask, conn->case_sensitive)) {
                        TALLOC_FREE(talloced);
                        continue;
                }
@@ -6969,7 +6968,7 @@ void reply_copy(struct smb_request *req)
                                continue;
                        }
 
-                       if(!mask_match(dname, fname_src_mask, get_Protocol(),
+                       if(!mask_match(dname, fname_src_mask,
                                       conn->case_sensitive)) {
                                TALLOC_FREE(talloced);
                                continue;
index 8226b6c..17ebd81 100644 (file)
@@ -1368,7 +1368,7 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
                                fname, mask);
        state->got_exact_match = got_match;
        if (!got_match) {
-               got_match = mask_match(fname, mask, get_Protocol(),
+               got_match = mask_match(fname, mask,
                                       state->conn->case_sensitive);
        }
 
@@ -1393,7 +1393,6 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
                state->got_exact_match = got_match;
                if (!got_match) {
                        got_match = mask_match(mangled_name, mask,
-                                              get_Protocol(),
                                               state->conn->case_sensitive);
                }
        }