gsudo icon indicating copy to clipboard operation
gsudo copied to clipboard

Issue: More than one instance of gsudo won't load in Windows Terminal when elevating as someone else.

Open mi271 opened this issue 2 years ago • 7 comments

I want to start an elevated CMD, Powershell or Powershell 7 Tab in Windows Terminal. First elevated Tab works fine, regardless if its cmd, Powershell or Powershell 7. Second elevated tab throws timeout exception.

Steps to Reproduce

Created a profile within Windows Terminal
  1. gsudo cmd.exe
  2. gsudo powershell.exe
  3. gsudo pwsh.exe

Screenshots

image image

Context:

  • Windows version: Windows 10 21H2 Buidl 19044.1826
  • gsudo version: 1.3.0 settings.txt

mi271 avatar Jul 14 '22 14:07 mi271

Ok. I see this happening only when invoking user is not admin, and you enter other user credentials.

This is what the debug window shows for the service. Screenshot 2022-07-14 233817

To be honest I am not sure when I will have time to address this! I hope soon.

On the meantime I may suggest you open regular WT tabs, then write gsudo, and press enter, to elevate it in place. It should support many tabs, although showing many UAC popups.

gerardog avatar Jul 15 '22 02:07 gerardog

Just for the info, it worked on my old laptop with gsudo 1.02 installed

mi271 avatar Jul 15 '22 06:07 mi271

Gotcha. Fixed the issue (0d99418).

Nonetheless there is still a problem with the cache not working as desired on this scenario.

To make the new process use the elevated user environment vars (as requested in #113, (which should be relevant when elevating as someone else) it is using the attached mode. In this mode, the cache is locked until the current attached elevation ends. So opening simultaneous tabs will ask for credentials several times, but opening sequential tabs (closing the former first) will result in cache success. Nonetheless I think that one deserves a new ticket.

gerardog avatar Jul 15 '22 12:07 gerardog

Do you want to test the fix? 😉

https://ci.appveyor.com/project/gerardog/gsudo/builds/44183555/artifacts

gerardog avatar Jul 15 '22 14:07 gerardog

The cache should also be fixed, at the cost of starting another background gsudo service, on attached mode.

gerardog avatar Jul 15 '22 14:07 gerardog

Will try it tomorrow when i get time. Friday is calling now

mi271 avatar Jul 15 '22 14:07 mi271

Thanks for the fix. Tried it today and it worked.

mi271 avatar Jul 24 '22 19:07 mi271