From f980d3ea14c020869102d8cd90fb69ecc2f78416 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 22 Dec 2007 17:38:18 -0800 Subject: 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) --- source3/smbd/filename.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source3/smbd/filename.c') 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; } -- cgit