From 445a9729f03117afdaa141a6d074d8af064b4399 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Mar 2005 19:33:02 +0000 Subject: r6044: Ensure the old search calls always ask mask_match to translate patterns like ????????.??? - even if using an NT1 protocol. Matches W2K3 behavior. Jeremy. (This used to be commit 67f6473f50f3284b9ccbe6f983f23cd42b3b7c9f) --- source3/lib/util.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index cd30ef9814..265302d2d4 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2475,7 +2475,23 @@ BOOL mask_match(const char *string, char *pattern, BOOL is_case_sensitive) if (strcmp(pattern,".") == 0) return False; - return ms_fnmatch(pattern, string, Protocol, is_case_sensitive) == 0; + return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0; +} + +/******************************************************************* + A wrapper that handles case sensitivity and the special handling + of the ".." name. Varient that is only called by old search code which requires + pattern translation. +*******************************************************************/ + +BOOL mask_match_search(const char *string, char *pattern, BOOL is_case_sensitive) +{ + if (strcmp(string,"..") == 0) + string = "."; + if (strcmp(pattern,".") == 0) + return False; + + return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0; } /******************************************************************* -- cgit