summaryrefslogtreecommitdiff
path: root/source3/smbd/filename.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-12-22 14:55:37 -0800
committerJames Peach <jpeach@samba.org>2007-12-22 14:55:37 -0800
commit596018455af0d80add90215689a80d336157429c (patch)
treee57331a0b8e0737da5fe4efb6b7d171a029402cf /source3/smbd/filename.c
parent4dc0c1b88be359cbf4e5273e1670ef0f87b9e36b (diff)
downloadsamba-596018455af0d80add90215689a80d336157429c.tar.gz
samba-596018455af0d80add90215689a80d336157429c.tar.bz2
samba-596018455af0d80add90215689a80d336157429c.zip
Use filesystem capabilities to support case-insensitive filesystems.
If we know the underlying filesystem is case-insensitive, then we know that it won't help to search for case variations of the requested name. Jeremy, please review (and revert if you disagree). (This used to be commit 9e8b8f8c16612d8a08b55802f4fd9afca5498a7c)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r--source3/smbd/filename.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index dc733d4568..f0d036b82b 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -735,6 +735,15 @@ static bool scan_directory(connection_struct *conn, const char *path,
path = ".";
}
+ /* If we have a case-sensitive filesystem, it doesn't do us any
+ * good to search for a name. If a case variation of the name was
+ * there, then the original stat(2) would have found it.
+ */
+ if (!mangled && !(conn->fs_capabilities & FILE_CASE_SENSITIVE_SEARCH)) {
+ errno = ENOENT;
+ return False;
+ }
+
/*
* The incoming name can be mangled, and if we de-mangle it
* here it will not compare correctly against the filename (name2)