If we detect a case insensitive filesystem make
authorJeremy Allison <jra@samba.org>
Sun, 23 Dec 2007 01:38:18 +0000 (17:38 -0800)
committerJeremy Allison <jra@samba.org>
Sun, 23 Dec 2007 01:38:18 +0000 (17:38 -0800)
sure we don't search directories on name misses
for non-mangled names.
Jeremy
(This used to be commit 120048d2f40cf1a0ace2ecde205cbc694d263d69)

source3/smbd/filename.c

index f0d036b82b5a38de1053a751cd9de448964ae52f..5ae193fb46b403e0671ae60e014f5613b785283b 100644 (file)
@@ -222,8 +222,14 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
        start = name;
 
-       if(!conn->case_sensitive
-          && stat_cache_lookup(conn, &name, &dirpath, &start, &st)) {
+       /* If we're providing case insentive semantics or
+        * the underlying filesystem is case insensitive,
+        * then a case-normalized hit in the stat-cache is
+        * authoratitive. JRA.
+        */
+
+       if((!conn->case_sensitive || !(conn->fs_capabilities & FILE_CASE_SENSITIVE_SEARCH)) &&
+                       stat_cache_lookup(conn, &name, &dirpath, &start, &st)) {
                *pst = st;
                goto done;
        }
@@ -269,10 +275,11 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
        /*
         * A special case - if we don't have any mangling chars and are case
-        * sensitive then searching won't help.
+        * sensitive or the underlying filesystem is case insentive then searching
+        * won't help.
         */
 
-       if (conn->case_sensitive &&
+       if ((conn->case_sensitive || !(conn->fs_capabilities & FILE_CASE_SENSITIVE_SEARCH)) &&
                        !mangle_is_mangled(name, conn->params)) {
                goto done;
        }