EldoS | Feel safer!

Software components for data protection, secure storage and transfer

move to replace a read-only file

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#30796
Posted: 09/22/2014 19:50:18
by Heidi Muehlebach (Standard support level)
Joined: 05/28/2014
Posts: 4

Hi,

I'm having a problem using CBFS when I move a file into a folder that already contains a file with that name. Additionally, the file in the folder is set to 'read-only'.

I am prompted by windows to confirm I want to replace the file, then the actual move of the file stalls.

Looking under the covers, it appears that windows just repeats the same steps over and over again. Below is some output captured with process monitor.

I've tried doing the same with the java sample provided with the CBFS distribution, and I get the same result.

The outcome I would like to achieve is preventing the move since the file is write protected. At the moment the infinite loop eventually just crashes the entire app.

What do I need to change to achieve this?

Thx,
Heidi

Output from process monitor:

SetRenameInformationFile Z:\read-only-overwrite.docx NAME COLLISION ReplaceIfExists: True, FileName: Z:\New folder\read-only-overwrite.docx CloseFile Z:\read-only-overwrite.docx SUCCESS CreateFile Z:\read-only-overwrite.docx SUCCESS Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened CloseFile Z:\read-only-overwrite.docx SUCCESS CreateFile Z:\New folder\read-only-overwrite.docx SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened QueryBasicInformationFile Z:\New folder\read-only-overwrite.docx SUCCESS CreationTime: 23/09/2014 9:08:06 AM, LastAccessTime: 23/09/2014 9:08:06 AM, LastWriteTime: 23/09/2014 9:08:06 AM, ChangeTime: 1/01/1601 10:00:00 AM, FileAttributes: R CloseFile Z:\New folder\read-only-overwrite.docx SUCCESS QueryDirectory Z:\New folder\read-only-overwrite.docx SUCCESS Filter: read-only-overwrite.docx, 1: read-only-overwrite.docx QueryDirectory Z:\New folder\read-only-overwrite.docx SUCCESS Filter: read-only-overwrite.docx, 1: read-only-overwrite.docx CreateFile Z:\read-only-overwrite.docx SUCCESS Desired Access: Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened QueryRemoteProtocolInformation Z:\read-only-overwrite.docx INVALID PARAMETER QuerySecurityFile Z:\read-only-overwrite.docx INVALID DEVICE REQUEST Information: DACL CloseFile Z:\read-only-overwrite.docx SUCCESS CreateFile Z:\read-only-overwrite.docx SUCCESS Desired Access: Read Attributes, Delete, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened QueryAttributeTagFile Z:\read-only-overwrite.docx SUCCESS Attributes: N, ReparseTag: 0x0 QueryBasicInformationFile Z:\read-only-overwrite.docx SUCCESS CreationTime: 23/09/2014 9:10:30 AM, LastAccessTime: 23/09/2014 9:10:30 AM, LastWriteTime: 23/09/2014 9:10:30 AM, ChangeTime: 1/01/1601 10:00:00 AM, FileAttributes: N
#30798
Posted: 09/23/2014 02:05:51
by Volodymyr Zinin (EldoS Corp.)

Moved to HelpDesk for further investigation.
#30830
Posted: 09/28/2014 17:17:13
by Heidi Muehlebach (Standard support level)
Joined: 05/28/2014
Posts: 4

This only happens on Windows 8.
Seems that for windows 8 only the 'read-only' flag shouldn't be returned when getting file attributes (onGetFileInfo).
If the file is read only, then 'access denied' should be returned when an attempt is made to open the file for writing, or for the onMoverOrRename action.

Thx,
Heidi
#30838
Posted: 09/29/2014 08:21:16
by Volodymyr Zinin (EldoS Corp.)

Please let's continue conversation in HelpDesk ticket 26139 that was created for this case.

Reply

Statistics

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