summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-22 17:38:18 -0800
committerJeremy Allison <jra@samba.org>2007-12-22 17:38:18 -0800
commitf980d3ea14c020869102d8cd90fb69ecc2f78416 (patch)
tree1a584885ae8ee3a4ba33c200154b4d7264eebce9 /source3/smbd
parentd75d3bc021c5f9242dd786ebf1aab57aadf7df23 (diff)
downloadsamba-f980d3ea14c020869102d8cd90fb69ecc2f78416.tar.gz
samba-f980d3ea14c020869102d8cd90fb69ecc2f78416.tar.bz2
samba-f980d3ea14c020869102d8cd90fb69ecc2f78416.zip
If we detect a case insensitive filesystem make
sure we don't search directories on name misses for non-mangled names. Jeremy (This used to be commit 120048d2f40cf1a0ace2ecde205cbc694d263d69)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/filename.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index f0d036b82b..5ae193fb46 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -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;
}