No chance to access file/folder with specific access rights

Please report only one bug per message!

Moderators: Stefan2, white, sheep, Hacker

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 » 2014-09-21, 01:29 UTC

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: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2014-09-22, 09:46 UTC

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
http://www.ghisler.com

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

Post by *MVV » 2014-09-22, 10:37 UTC

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 » 2014-09-22, 12:36 UTC

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: 8244
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2014-09-22, 12:44 UTC

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 » 2014-09-22, 12:53 UTC

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: 8244
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2014-09-22, 13:01 UTC

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 » 2014-09-22, 13:06 UTC

Hmm, is tcmadmin used under Windows XP or older?

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

Post by *MVV » 2014-09-22, 13:19 UTC

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 » 2014-09-22, 13:45 UTC

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: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2014-09-25, 14:39 UTC

You can still do it via button bar, by calling the Windows "runas" program.
Author of Total Commander
http://www.ghisler.com

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

Post by *MarcinW » 2014-09-26, 22:44 UTC

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: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2014-09-29, 10:47 UTC

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
http://www.ghisler.com

User avatar
Dalai
Power Member
Power Member
Posts: 6534
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2014-09-29, 10:57 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

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

Post by *ghisler(Author) » 2014-10-02, 09:46 UTC

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

Post Reply