EldoS | Feel safer!

Software components for data protection, secure storage and transfer

About FUSE path

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#33885
Posted: 07/03/2015 22:41:56
by tao yu (Standard support level)
Joined: 12/25/2014
Posts: 14

Hi,
I'm working on a CBFS application based on FUSE sample, and I found a situation as follows:

1.The path "\dira\dirb\" already exists,

2.The application is mounted as "M:\" and don't do other operations,
3.Call windows API CreateFile("M:\\DIRA\\DIRB", ...) directly by c++ test-case,
then FUSE can receive path "\DIRA\DIRB".

4.The application is mounted as "M:\" and I lookup "M:\dira\dirb" by explorer.exe first,
5.Call windows API CreateFile("M:\\DIRA\\DIRB", ...) directly by c++ test-case,
then FUSE can receive path "\dira\dirb".

How can FUSE get "\dira\dirb" when the application is mounted and don't lookup the path first?

Thanks very much for your help!
#33886
Posted: 07/04/2015 00:38:34
by Eugene Mayevski (EldoS Corp.)

Filesystems in Windows are case-insensitive (while there is some support for case-sensitive mode available, it's not complete and as such very confusing). There's no way to tell the filesystem pass you any strings in the case you want.

When you get the file mask or the file name, you should match the name exactly first (in case-sensitive manner) and if such name is not found, perform case-insensitive matching.

This algorithm is done to ensure that if you have both DIRA and DIRB (the situation which is possible), the application can open the correct file.


Sincerely yours
Eugene Mayevski
#33914
Posted: 07/07/2015 07:13:13
by tao yu (Standard support level)
Joined: 12/25/2014
Posts: 14

Thanks for your last answer and I have a new problem:

I cannot rename c.txt to C.txt (not by windows api),both SetCaseSensitiveFileNames true and false.

Is there any method or setting can do this?

Thanks very much!


#33923
Posted: 07/07/2015 09:49:56
by Volodymyr Zinin (EldoS Corp.)

CBFS is always "name case preserved". I.e. when someone creates or renames a file the OnCreate and OnRename callbacks are called with the same case sensitive file name as in the originator request that the system sends to the CBFS file system.
In the case the "c.txt" file is renamed to "C.txt" you should receive the OnRename callback.
Of course if the file was initially created or opened as "C.txt", then you reopened it as "c.txt" and tries to rename to "C.txt" the OnRename callback isn't called because CBFS thinks that the file is already "C.txt".
#33924
Posted: 07/07/2015 09:57:25
by Volodymyr Zinin (EldoS Corp.)

Actually use of SetCaseSensitiveFileNames is necessary only for UNIX subsystem (like Interix). The programs for this subsystem are case sensitive and the files "C.txt" and "c.txt" are considered to be two different files and can coexist. In the case your CBFS based file system needs to support such programs (for example NFS server) then set SetCaseSensitiveFileNames to true.
#33936
Posted: 07/07/2015 22:03:36
by tao yu (Standard support level)
Joined: 12/25/2014
Posts: 14

In the case the "c.txt" file is renamed to "C.txt" you should receive the OnRename callback.
------
Actually I don't receive the OnRename callback.

There are some driver logs:
CBFS: explorer.exe #SET_INFORMATION -> f802960
CBFS: explorer.exe #SET_INFORMATION \test\test.conf Rename
CBFS: CbFsDecodeFileObject, FileObject = 0f4f45a0
CBFS: CbFsVerifyFcb, Vcb = 01c346f0
CBFS: The Vcb is good
CBFS: The Fcb is good
CBFS: CbFsSetRenameInfo...
CBFS: CbFsPurgeReferencedFileObjects, Fcb = 01c346f0
CBFS: CbFsFspClose
CBFS: CbFsDecodeFileObject, FileObject = 0d289a20
CBFS: test-cbfs.exe #IRP_MJ_CBFS *** Status: STATUS_NO_SUCH_FILE (0xc000000f) ***
CBFS: CbFsExceptionFilter: Exception STATUS_OBJECT_NAME_COLLISION
CBFS: CbFsSetRenameInfo - Abnormal termination.
CBFS: CbFsSetRenameInfo -> STATUS_OBJECT_NAME_NOT_FOUND
CBFS: CbFsCommonSetInformation - Abnormal termination.
CBFS: CbFsCommonSetInformation -> STATUS_SUCCESS
CBFS: CbFsProcessException STATUS_OBJECT_NAME_COLLISION
CBFS: explorer.exe #SET_INFORMATION *** Status: STATUS_OBJECT_NAME_COLLISION (0xc0000035) ***
CBFS: CbFsSetInformation -> STATUS_OBJECT_NAME_COLLISION
CBFS: System #CLEANUP -> f802960
CBFS: System #CLEANUP TEST.conf
CBFS: System FO_HANDLE_CREATED
CBFS: CbFsCommonCleanup

What should I do?
#33941
Posted: 07/08/2015 04:49:14
by Volodymyr Zinin (EldoS Corp.)

Moved to Helpdesk for further investigation.
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

Topic viewed 3392 times

none




|

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!