EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Stop read operation

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#23095
Posted: 01/09/2013 10:41:16
by Davide Baccaglini (Standard support level)
Joined: 11/19/2012
Posts: 48

No, every file are opened with the correct application.

You're right, the error message (File doesn't exist) depends on the application.
In fact :
- when I open "Z:\Example.txt" the error is "File doesn't exist. Create it?";
- when I open "Z:\Example.pdf" the error is "There was an error opening this document. Access denied";
- when I open "Z:\Example.docx" the error is "Word cannot open the document : user does not have access privileges".

So, there is not a way to prevent to open a file?
#23096
Posted: 01/09/2013 10:41:24
by Eugene Mayevski (EldoS Corp.)

Here's the test you can do easily:

try opening the file on the virtual disk from your code and see the error returned.


Sincerely yours
Eugene Mayevski
#23097
Posted: 01/09/2013 10:43:41
by Eugene Mayevski (EldoS Corp.)

I don't understand what you want. You ARE preventing the file from being opened right now. The file is NOT opened and you get the error.


Sincerely yours
Eugene Mayevski
#23098
Posted: 01/09/2013 10:54:50
by Davide Baccaglini (Standard support level)
Joined: 11/19/2012
Posts: 48

I want to simulate the behavior of windows RecycleBin in a folder contained in my virtual storage.

In this folder I was able to prevent the creation of new files (using Access Denied) and now I want to prevent to open existing file in this special folder and show, if possible, a message like the prevent of creation (Access Denied Error).

But, if I reply the posted code in OnOpenFile event it didnt't works, because in this case error are manage by single application and in fact all files are opened even if I throw an ECBFSError.
#23099
Posted: 01/09/2013 11:02:43
by Eugene Mayevski (EldoS Corp.)

I think that either you describe not what you have or don't exactly follow what happens.

You have stated that attempt to open the file in different applications has lead to the error message. The file is not opened after this error message. I don't see any problems in the described behaviors - it corresponds to how the things should work.


Sincerely yours
Eugene Mayevski
#23100
Posted: 01/09/2013 11:08:04
by Davide Baccaglini (Standard support level)
Joined: 11/19/2012
Posts: 48

Ok, but I want a way to show only a message like creation not open the correct application and show the error. I don't want to open the application with an empty file.

Maybe now I was able to explain properly =)
#23101
Posted: 01/09/2013 11:10:53
by Eugene Mayevski (EldoS Corp.)

Ok, finally we've moved further :). If the OS knows that the file exists (you have returned file name when directory was enumerated), it has no chance to know that there's no access allowed to the file for some particular application. So it starts the application and the application attempts to open the file. This is normal OS logic and I have yet to see anything different.

In other words, it's not the OS that initiates opening the file and after that runs an application, but the application is started first, and then *it* attempts to open the file.


Sincerely yours
Eugene Mayevski
#23110
Posted: 01/10/2013 02:52:11
by Davide Baccaglini (Standard support level)
Joined: 11/19/2012
Posts: 48

Ok Eugene, now I know that I can't disable to open file =)

I can manage my RecycleBin folder in this way :
- disable edit file (to-do)
- disable create file (done)
- disable rename file (done)
- enable to open file (normal operation)

To disable edit file function I can modify OnSetFileAttributes : when user delete a file this is moved in RecycleBin folder and its attribute changed to read-only mode. After that when user try to edit file attributes OnSetFileAttributes prevent to disable read-only mode fot these files.

It's right?
#23111
Posted: 01/10/2013 03:40:16
by Eugene Mayevski (EldoS Corp.)

Quote
Davide Baccaglini wrote:
Ok Eugene, now I know that I can't disable to open file =)


This is an incorrect statement. The file is not opened in your case.
Quote
Davide Baccaglini wrote:
To disable edit file function I can modify OnSetFileAttributes : when user delete a file this is moved in RecycleBin folder and its attribute changed to read-only mode. After that when user try to edit file attributes OnSetFileAttributes prevent to disable read-only mode fot these files.

It's right?


No. Read-only attribute is a leftover of old DOS times and even then it was purely informative and didn't restrict anything. To prevent file edit operations you need to cancel Create and Open_for_writing operations.


Sincerely yours
Eugene Mayevski
#23112
Posted: 01/10/2013 03:56:14
by Davide Baccaglini (Standard support level)
Joined: 11/19/2012
Posts: 48

Quote
To prevent file edit operations you need to cancel Create and Open_for_writing operations.


I dont't understand what changes I need to make to OnCreateFile and OnOpenFile events. In both cases file desired access are input fields and I can't modify it.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

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