TC overwrites w/o ask on unpack to some folders

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

TC overwrites w/o ask on unpack to some folders

Post by *MVV »

You can test it with C:\Windows\Temp folder, it doesn't allow users to list files but allows to create/modify existing ones.

Using user account try to copy any file into C:\Windows\Temp folder (you may need 'as admin' button to enter folder before). And then try to copy file with same name into it - TC asks for overwrite. Now try to unpack file with same name into C:\Windows\Temp - TC overwrites w/o ask!

It is expected that TC will ask user if he wants to overwrite file.

Same behaviour occurs on WXP and W7.
User avatar
wanderer
Power Member
Power Member
Posts: 1578
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: TC overwrites w/o ask on unpack to some folders

Post by *wanderer »

MVV wrote:You can test it with C:\Windows\Temp folder, it doesn't allow users to list files but allows to create/modify existing ones.
That's not true. I can list files too. Maybe because i'm admin...
MVV wrote:Now try to unpack file with same name into C:\Windows\Temp - TC overwrites w/o ask!
TC's unpack dialog has an "Overwrite existing files" option. ;)
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: TC overwrites w/o ask on unpack to some folders

Post by *MVV »

wanderer wrote:That's not true. I can list files too. Maybe because i'm admin...
MVV wrote:You can test it with C:\Windows\Temp folder, it doesn't allow users to list files but allows to create/modify existing ones.
...
Using user account try to copy any file into C:\Windows\Temp folder (you may need 'as admin' button to enter folder before).
Admins just can list files so bug is not visible. You need limited account.
wanderer wrote:TC's unpack dialog has an "Overwrite existing files" option. ;)
As I wrote, I do both tests one by other and don't change any options, and when I unpack to one folder TC asks to overwrite but when I unpack to another folder TC doesn't ask.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm sorry, it's currently not possible to handle that situation of a folder where reading is forbidden but writing allowed. Why? TC has to check before unpacking a file whether the target exists or not. This is unfortunately not possible when reading from the target is impossible.

Edit: It seems that there is a way to check it - via CreateFile (for reading). TC uses FindFirstFile because it's much faster, but I can revert to CreateFile if the access is denied.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Maybe TC should use GetFileAttributes instead of FindFirstFile? I think it will be even more faster since no handle is used and no data returned besides attributes. :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm using all 3, in a mix which has been proven to work in many situations (except for the above). I will not change this now just before the release, sorry.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, if no one hadn't reported this before it isn't frequently used:) but I think you'll fix it before releasing TC 8. :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, of course I fix it already in TC 7.55 - it's easy, just check with CreateFile when FindFirstFile returns error 5 (access denied), just as I do now in case of error 0 (file found).

But I will not switch to GetFileAttributes instead of FindFirstFile, this could have unpredictable results.
Author of Total Commander
https://www.ghisler.com
User avatar
romulous
Senior Member
Senior Member
Posts: 226
Joined: 2003-11-19, 04:10 UTC

Post by *romulous »

Hm, interesting. Sounds similar to the bug I reported a while back where in some cases TC will overwrite a file without prompting when a CTRL+S filter is active in the destination folder when you do a file move from one folder to another. Obviously not the same circumstances as in this case, but the same effect - the file overwriting dialog is suppressed. Oh well, bugs happen I suppose.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2romulous
Unfortunately I could not reproduce your problem. It's completely unrelated, because TC doesn't look in the target panel list whether a file exists or not. TC looks directly on the harddisk, so the state of the Ctrl+S function doesn't matter.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thanks, bug is fixed in 7.55 final. :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply