From 4b7684122b8031635125d22e0ae0e32d13a45879 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sun, 1 Oct 2017 11:07:01 -0700 Subject: [PATCH] dll: fuse: disable GetDirInfoByName when file system is case-insensitive --- src/dll/fuse/fuse.c | 8 ++++++++ src/dll/fuse/fuse_intf.c | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index 3079ced6..50f88549 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -305,6 +305,14 @@ static NTSTATUS fsp_fuse_svcstart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv) context->private_data = f->data = f->ops.init(&conn); f->VolumeParams.ReadOnlyVolume = 0 != (conn.want & FSP_FUSE_CAP_READ_ONLY); f->VolumeParams.CaseSensitiveSearch = 0 == (conn.want & FSP_FUSE_CAP_CASE_INSENSITIVE); + if (!f->VolumeParams.CaseSensitiveSearch) + /* + * Disable GetDirInfoByName when file system is case-insensitive. + * The reason is that Windows always sends us queries with uppercase + * file names in GetDirInfoByName and we have no way in FUSE to normalize + * those file names when embedding them in FSP_FSCTL_DIR_INFO. + */ + f->VolumeParams.PassQueryDirectoryFileName = FALSE; f->conn_want = conn.want; } f->fsinit = TRUE; diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index a901ccc6..534d9cbc 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -806,10 +806,9 @@ static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem, } /* - * Ignore fuse_file_info::direct_io, fuse_file_info::keep_cache - * WinFsp does not currently support disabling the cache manager - * for an individual file although it should not be hard to add - * if required. + * Ignore fuse_file_info::direct_io, fuse_file_info::keep_cache. + * NOTE: Originally WinFsp dit not support disabling the cache manager + * for an individual file. This is now possible and we should revisit. * * Ignore fuse_file_info::nonseekable. */