Privilege escalation not working at Syncronize dirs

Please report only one bug per message!

Moderators: Stefan2, white, sheep, Hacker

Post Reply
AdrianB1
Junior Member
Junior Member
Posts: 11
Joined: 2010-04-19, 08:39 UTC
Location: Bucharest, RO

Privilege escalation not working at Syncronize dirs

Post by *AdrianB1 » 2010-04-19, 08:49 UTC

Hi, I searched for a report of this bug and I could not find one, so I hope I am not double reporting.

I have a computer with 2 hard drives running Win 7 x64, TC 7.50a. The second drive in the computer that is write protected to all except administrators - that drive is kind of a soft backup of the first drive. I copy files (F5) from the first drive to the second, privilege escalation is triggered, I confirm, it works. I try to do the same by synchronizing the directories and it starts copying from drive 1 to 2, it asks for privilege escalation, I confirm, I get an error that the current file on drive 2 cannot be accessed - it is supposed to be overwritten.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37417
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-04-20, 16:24 UTC

I will check that, thanks for your report.
Author of Total Commander
http://www.ghisler.com

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

Post by *MVV » 2010-04-21, 08:53 UTC

Here my tries:

0. If target may be read by user (but may be written only by admin), and target file doesn't exist, TC shows error, I choose 'as admin', file is copied.

1. Like 0, but target file exists. TC asks to replace, I choose 'as admin', file is replaced.

2. Like 0, but file is copied into subfolder of protected folder, and this subfolder doesn't exist. TC shows error, I choose 'as admin', but TC fails to create subfolder and file is not copied.

3. If target is inaccessible for user (only admin have read/write access), and I entered to target folder in TC using 'as admin', I open sync tool and it suggests to copy all folders contents from source to target (since sync tool can't see contents of target subfolders so can't compare them with source). So I need to start sync tool from elevated TC instance anyway.


Maybe it is possible to move all operations code (sync, copy, move, split, merge) to some DLL so both TC and TCMADMIN can use it (theese functions will receive just filelists and maybe some environment)?

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37417
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-04-22, 16:03 UTC

2MVV
I couldn't reproduce the original error reported by AdrianB1 (overwriting existing files). Can you reproduce it?

Folder creation is indeed not currently supported, sorry. Maybe in a later release.
Author of Total Commander
http://www.ghisler.com

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

Post by *MVV » 2010-04-22, 16:40 UTC

ghisler,
I can't reproduce it too, my tests show it. I'm using sync frequently (within write-protected folders too) but I can't say that TC fails on overwriting files.

AdrianB1,
Can you reproduce error any time you want? Please try to reproduce it with clean INI (start TC with parameter /i=newini.ini). If you can reproduce error, please give us step-by-step instructions.

AdrianB1
Junior Member
Junior Member
Posts: 11
Joined: 2010-04-19, 08:39 UTC
Location: Bucharest, RO

Post by *AdrianB1 » 2010-04-23, 09:42 UTC

I can reproduce it, I will try with the newini option and come back with the answer.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37417
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-04-23, 15:46 UTC

Thanks, that would be nice! I haven't changed that in TC 7.55 beta yet, so it's sufficient when you test it with TC 7.50a.
Author of Total Commander
http://www.ghisler.com

AdrianB1
Junior Member
Junior Member
Posts: 11
Joined: 2010-04-19, 08:39 UTC
Location: Bucharest, RO

Post by *AdrianB1 » 2010-04-25, 19:30 UTC

I tested today with /i=newini.ini and the scenarios presented by MVV. The destination folder has the following NTFS rights: Everyone: read only; Administrators: Full Control; the current user is an administrator and privilege escalation is triggered.
0. It works
1. Not tested
2. It does not work. It does not create the subfolder before copying the first file, so it cannot work. I created the subfolder manually (using TC but with F7), it does so and when I try again to sync the files for this subfolder it works as expected (asking for privilege escalation).

Just guessing (I hope I am not anoying with the speculations) that the subfolder creation does not ask for privilege escalation (I see no prompt for this), it tries and fails, next the file copy fails as the target subfolder does not exist.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37417
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-04-26, 16:26 UTC

Yes, I have already confirmed the subfolder problem above, it will be fixed in the next beta. However, I still cannot reproduce the situation described in your first post, where overwriting of an existing file would fail due to privilege problems. In that case, the folder already exists, otherwise the file couldn't exist there either.
Author of Total Commander
http://www.ghisler.com

AdrianB1
Junior Member
Junior Member
Posts: 11
Joined: 2010-04-19, 08:39 UTC
Location: Bucharest, RO

Post by *AdrianB1 » 2010-04-27, 10:57 UTC

Unfortunately I cannot redo the tests because I synchronized manually (copy+overwrite) everything and now there are no more such differences.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37417
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-04-27, 15:44 UTC

OK, just let me know if you encounter it again in the future.
Author of Total Commander
http://www.ghisler.com

Post Reply