diff options
author | Jeremy Allison <jra@samba.org> | 2005-03-24 19:33:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:18 -0500 |
commit | 445a9729f03117afdaa141a6d074d8af064b4399 (patch) | |
tree | 2566a2fa851e77ac4df41a359ded2c0b3919eba8 /source3/lib/util.c | |
parent | 0a11209325caf24ef7f09c963c4795147b62fdd2 (diff) | |
download | samba-445a9729f03117afdaa141a6d074d8af064b4399.tar.gz samba-445a9729f03117afdaa141a6d074d8af064b4399.tar.bz2 samba-445a9729f03117afdaa141a6d074d8af064b4399.zip |
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)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 18 |
1 files changed, 17 insertions, 1 deletions
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; } /******************************************************************* |