From 6185fbad47e63f64599582ec9246f2df7c416942 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 2 Oct 2004 05:09:16 +0000 Subject: r2776: if there are no wildcard characters then use StrCaseCmp() 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 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4') diff --git a/source4/lib/ms_fnmatch.c b/source4/lib/ms_fnmatch.c index d072eb6a50..507d2aea4a 100644 --- a/source4/lib/ms_fnmatch.c +++ b/source4/lib/ms_fnmatch.c @@ -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); -- cgit