EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Another case sensitivity post

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
Posted: 12/23/2015 07:50:31
by Yves Langisch (Standard support level)
Joined: 06/17/2015
Posts: 24


We're using CBFS 6 .NET to mount a remote linux filesystem allowing all common file/directory operations. Altough I think all settings are correct we have issues with case sensitivity:

  • CaseSensitiveFileNames = true
  • FileSystemName = "NTFS"
  • In GefFileInfo I set the case sensitive realFilename

In this case all operations are done through Windows Explorer. The listing works fine. I can see the two files:

  • file.txt
  • File.txt

Trying to delete file.txt I get the OnDeleteFile callback sometimes with file.txt, sometimes with File.txt as parameter.

What could be wrong?

Posted: 12/23/2015 09:17:33
by Volodymyr Zinin (EldoS Corp.)

Hello Yves,

Windows by itself is case insensitive. So Windows programs expect a file is opened by specifying any case insensitive file name. From their view the file names "file.txt" and "FiLe.TXT" belong to the same file.
CBFS in most cases tries to use an exact case sensitive file name during file opening and others operations. But sometimes it fails. For example there are two files "file.txt" and "File.txt". No one is opened yet. Then some program opens "File.txt" and later another program is opening "file.txt". During the last opening the CBFS driver sees that the program isn't case sensitive and there is already opened "File.txt". So the metadata for "File.txt" is used for the last opening and finally the file "File.txt" will be opened.
Theoretically in such situation CBFS should ask via OnGetFileInfo callback whether the file must be opened only by exact case sensitive file name even if the originator program is case insensitive. But I am not sure that it will work correctly in all cases.

Regarding the CallbackFileSystem.CaseSensitiveFileNames property. It matters only to support applications for UNIX (Interix) subsystem. For example if you application wants to support POSIX applications or NFS shares. When this property is set CBFS checks whether the application during file opening specifies the case sensitive name and allows to open file only in the case of strict correspondence. But for other openings CBFS still treats file names as case insensitive.
I know only one way to open a file as case insensitive - it's done by the use of nt-API, like ZwCreateFile and ZwOpenFile. There is a flag there OBJ_CASE_INSENSITIVE. Also in the registry it is required to set a special flag which tells Windows to handle this flag. Here is a n information about it: http://technet.microsoft.com/en-us/li...25747.aspx



Topic viewed 1736 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!