r2776: if there are no wildcard characters then use StrCaseCmp()
authorAndrew Tridgell <tridge@samba.org>
Sat, 2 Oct 2004 05:09:16 +0000 (05:09 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:32 +0000 (12:59 -0500)
note that this is not just an optimisation, it fixes a rare edge case
when LANMAN1 is negotiated
(This used to be commit 8d879cf54c2fe09d62a5c28b02a070cb80984744)

source4/lib/ms_fnmatch.c

index d072eb6a50cc1f33adb79f7918fe885c7e16eff3..507d2aea4a8b17d0cd1e19afd3cedbcebf70008d 100644 (file)
@@ -150,6 +150,12 @@ int ms_fnmatch(const char *pattern, const char *string, enum protocol_types prot
                string = ".";
        }
 
+       if (strpbrk(pattern, "<>*?\"") == NULL) {
+               /* this is not just an optmisation - it is essential
+                  for LANMAN1 correctness */
+               return StrCaseCmp(pattern, string);
+       }
+
        pstrcpy_wa(p, pattern);
        pstrcpy_wa(s, string);