EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Virtual disk crash after throw ECBFSError(0x5)

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.
#21596
Posted: 09/18/2012 11:00:05
by alex  (Basic support level)
Joined: 09/18/2012
Posts: 6

Hi
I investigate cbfs.
My interest, can i restrict access for folder?
I created test app based on VDisk.
when i try throw exception (ERROR_ACCESS_DENIED 5 (0x5) Access is denied.) on read folder then disk is crashed.
os give message like no access to disk
Maybe i use not correct error code, when i want restrict access to folder ?

i user java api
Callback File System - Version 3.2.115
#21597
Posted: 09/18/2012 11:17:40
by Volodymyr Zinin (EldoS Corp.)

It's better to check restriction when a file or folder is being created or opened (i.e. at the time the OnCreate or OnOpen callback is called). Set the CallbackFS CallAllOpenCloseCallbacks property to true and throw the ERROR_ACCESS_DENIED exception if the opening isn't allowed. In this case the originator of the request won't obtain handle to the file/directory and not be able to do any other I/O operations.
#21598
Posted: 09/18/2012 11:17:44
by Eugene Mayevski (EldoS Corp.)

Please elaborate on what "disk is crashed" is supposed to mean. What exactly message is shown or what else happens?

It can be that the problem is specific to Java API (not correct error translation) so please doing the same with other (.NET or C++) sample and see if the behavior is the same.


Sincerely yours
Eugene Mayevski
#21616
Posted: 09/19/2012 04:41:30
by alex  (Basic support level)
Joined: 09/18/2012
Posts: 6

Thanks.
Vladimir now it's work.
But have same strange behavior
I want that in the root directory could not create files / folders.
In this case, for example, when viewing the properties of the disk size shows zero (CallAllOpenCloseCallbacks property to true). But if you go into a disk, then back to a higher level (the computer), it shows the size of the Windows drive is normal, while again not to go into the properties :)
And it's seems that afterproperties CallAllOpenCloseCallbacks set true next line of code with throw new ECBFS Error(5) never call.
#21619
Posted: 09/19/2012 04:52:35
by Volodymyr Zinin (EldoS Corp.)

CallAllOpenCloseCallbacks must be set once before the CallbackFS MountMedia call.

About the problem with disk size - get Process Monitor from sysinternals.com, create a CallbackFS virtual disk, run Process Monitor and set there the filter "Path"->"begins with"->"X:" (where "X:" is the virtual drive letter), reproduce the problem, and find in the log what an operation returns the error. Often it helps to find out where the problem is. In your case most probably it's because you don't allow to open the root folder (i.e. "\") or some file/directory which handle is then used to request the disk size.
#21621
Posted: 09/19/2012 05:55:38
by alex  (Basic support level)
Joined: 09/18/2012
Posts: 6

if set CallAllOpenCloseCallbacks once before the CallbackFS MountMedia call, then disk mounts, but if we try open him windows give message like insert the disc into the device
#21622
Posted: 09/19/2012 06:25:47
by Volodymyr Zinin (EldoS Corp.)

I was wrong. Set this property before the CreateStorage call.
#21627
Posted: 09/19/2012 12:50:02
by alex  (Basic support level)
Joined: 09/18/2012
Posts: 6

it's seems that i confused
in base app VDisk i added next lines of code

1. onMount event i create folder "root" - all good and works
2. in Main class before create storage
Code
cbfs.setCallAllOpenCloseCallbacks(true);
cbfs.createStorage();


3. onCreate event add check
Code

if(vdir.getParent() == null){
            throw new ECBFSError(5);
        }

for blocking create folder/files at first level

after that it says me denied access, even just open disk R: "denied access"
Plz help.

java api
Callback File System - Version 3.2.115
#21633
Posted: 09/20/2012 01:54:31
by Volodymyr Zinin (EldoS Corp.)

Quote
alex wrote:
1. onMount event i create folder "root" - all good and works

What does it mean?

Quote
alex wrote:
after that it says me denied access, even just open disk R: "denied access"

Take Process Monitor as I suggested above and try to find out the reason of the problem in the log. If it doesn't help, give the log (in the Process Monitor native format) to me.
#21634
Posted: 09/20/2012 02:39:47
by alex  (Basic support level)
Joined: 09/18/2012
Posts: 6

1. On action mount created def folder "Root"

log in attachment, just rename it *.pml


[ Download ]
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

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