From f9b750542933cb60eca7da335193c36361496622 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Oct 2005 01:42:03 +0000 Subject: r11346: Fix for bug found by Dina Fine. If in case sensitive mode then the mangle cache is no good (3 letter extension could be wrong case - so don't demangle in this case - leave as mangled and allow the mangling of the directory entry read (which is done case insensitively) to match instead. This will lead to more false positive matches but we fail completely without it. Jeremy. (This used to be commit 238b35d2e6e21d0e07d500d446f08ec128ea7720) --- source3/smbd/filename.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index f0a33e568e..b389b9c1ae 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -445,9 +445,18 @@ static BOOL scan_directory(connection_struct *conn, const char *path, char *name * read from the directory and then mangled by the mangle_map() * call. We need to mangle both names or neither. * (JRA). + * + * Fix for bug found by Dina Fine. If in case sensitive mode then + * the mangle cache is no good (3 letter extension could be wrong + * case - so don't demangle in this case - leave as mangled and + * allow the mangling of the directory entry read (which is done + * case insensitively) to match instead. This will lead to more + * false positive matches but we fail completely without it. JRA. */ - if (mangled) + + if (mangled && !conn->case_sensitive) { mangled = !mangle_check_cache( name, maxlength, SNUM(conn)); + } /* open the directory */ if (!(cur_dir = OpenDir(conn, path, NULL, 0))) { -- cgit