No chance to access file/folder with specific access rights

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

No chance to access file/folder with specific access rights

Post by *MarcinW »

Steps to reproduce:
1) Create "C:\Test" folder.
2) Open its Properties, go to Security tab:
- remove all access rights,
- add full access rights for some user, that you are not currently logged in as, but also not for Administrator (for example add access rights for Guest).
3) Try going into "C:\Test" - TC says "Access denied on file". Now:
- Windows XP and older: press "As Administrator" button, enter user name (Guest in this example) and his password - now you have access to the folder,
- Windows Vista and newer: press "As Administrator" button, allow UAC to go on - by using tcmadmin.exe, TC tries to access "C:\Test" as Administrator, but the folder has no access rights for Administrator, tcmadmin.exe silently fails and nothing happens.

Solution: when tcmadmin.exe returns an error code (or only some specific error code?), TC should perform same procedure as in older Windows versions - ask for user name and his password.

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

Post by *ghisler(Author) »

It's not the same: On XP, TC starts tcmadmin.exe with the credentials of the specific Administrator user. On Vista and newer, TC starts tcmadmin with elevation. Apparently not even the elevated user has read rights to the file here, so access will of course fail.
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 »

Sometimes I miss that lost functionality (to be able to start tcmadmin with another user's credentials) too, but as I remember, it was discussed already somewhere...
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

So maybe this should have been posted as a suggestion...

So my suggestion is: when tcmadmin.exe returns an error code (or only some specific error code?), TC should perform same procedure as in older Windows versions - ask for user name and his password.

After all, the goal for the user is to access the file or folder - so, if tcmadmin.exe fails, let's give the user a chance to enter his own credentials.
Last edited by MarcinW on 2014-09-22, 12:50 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Problem is that you can't have multiple tcmadmins running with different credentials... but you may need them in such case, and it may require many changes.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

So, under Vista and newer, it's no longer programatically possible just to ask for user name and password, create some access token and access file or folder?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is possible, you still can start programs under different user via context menu (just hold Shift to see extended menu items). But currently TC doesn't provide such function.

BTW I think under Windows XP it is still possible to get similar problem if you do some action using one credentials and then want to do some action using another one (when tcmadmin is still running).
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Hmm, is tcmadmin used under Windows XP or older?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is used for both, it is just running with different credentials.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

MVV wrote:Problem is that you can't have multiple tcmadmins running with different credentials...
So I think there is no problem. We don't have to launch multiple tcmadmins at the same time - we can launch tcmadmin with elevation first, and if it fails (due to no file/folder access rights for Administrator), we ask user for credentials and launch tcmadmin with credentials given by him.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can still do it via button bar, by calling the Windows "runas" program.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Yes, this is a useful workaround. Would it be very complicated to implement such functionality directly in TC?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I think that there is no direct way to do this on Windows Vista and later. TC calls tcmadmin.exe with verb "runas" on XP and Vista/7/8, but it has different effects: While it shows the user/password dialog on XP, it uses the elevation mechanism on newer Windows versions. I don't know of any way to get the old behaviour also on Vista/7/8.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:I don't know of any way to get the old behaviour also on Vista/7/8.
Use the verb "runasuser" to get the "Run As" dialog known from XP and earlier.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, thanks for the info!
Author of Total Commander
https://www.ghisler.com
Post Reply