EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Cannot write-open a read-only directory.

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.
#37132
Posted: 06/29/2016 04:15:17
by Kunikazu Okada (Standard support level)
Joined: 05/12/2016
Posts: 3

Hello,I've found this symtom with CBFS 6.1.178 .

Symptom:
Calling CreateFile on a read-only directory under a CBFS hosted filesystem
always fails without firing CBFS.OnOpenFile event.

How to reproduce
Create a directory on CBFS.

Set FILE_ATTRIBUTE_READONLY to the directory by calling
SetFileAttribute Windows API.

Open the folder for write access:
CreateFile(Pchar(aFileName),
GENERIC_WRITE,
FILE_SHARE_READ,
nil,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
0);
Actual result :
CreateFile(directory with READ_ONLY, GENERIC_WRITE) fails;

Expected result:
CreateFile(directory with READ_ONLY, GENERIC_WRITE) succeeds;
It actually succeeds on a local ntfs .

Comment:
MSDN says that FILE_ATTRIBUTE_READONLY is not honored on directories.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365535(v=vs.85).aspx

Actually, there are few directory with readonly attribute .

Because explorer skip directories when it recursively sets
readOnly attribute of a directory tree ,
so you cannot set FILE_ATTRIBUTE_READONLY by Windows Explorer.

Thanks you.
#37143
Posted: 07/01/2016 07:37:19
by Volodymyr Zinin (EldoS Corp.)

Thank you for the detailed description of the problem. It will be fixed in the next build.

Reply

Statistics

Topic viewed 684 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!