gerardog/gsudo

Issue: Multiple simultaneous gsudo versions throw "Unauthorized. (Different gsudo.exe?)"

gerardog opened this issue · 0 comments

Issue Description

Gsudo is portable but : If you start a cache using one gsudo.exe file, and then invoke another gsudo.exe file (i.e. a copy), the Unauthorized. (Different gsudo.exe?)" error appears

Steps to Reproduce

PS C:\git\gsudo\artifacts\x64> dir

    Directory: C:\git\gsudo\artifacts\x64

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---            8/7/2023    11:36            717 gsudo
-a---           19/8/2023    19:41        5861376 gsudo.exe
-a---           19/8/2023    19:41       22269952 gsudo.pdb
-a---           19/8/2023    19:42           4347 gsudoModule.psd1
-a---           19/8/2023    19:36          10110 gsudoModule.psm1
-a---           20/7/2023    22:59           6493 Invoke-ElevatedCommand.ps1
-a---           19/8/2023    19:34           6832 Invoke-gsudo.ps1

PS C:\git\gsudo\artifacts\x64> cp .\gsudo.exe .\gsudo2.exe

PS C:\git\gsudo\artifacts\x64> .\gsudo.exe config cachemode auto
Info: Config Setting for 'CacheMode' will be set as global system setting.
Info: Global system settings requires elevation. Elevating...
Warning: Enabling the credentials cache is a security risk.
CacheMode = "Auto"

PS C:\git\gsudo\artifacts\x64> .\gsudo.exe echo Hello
Hello

PS C:\git\gsudo\artifacts\x64> .\gsudo2 echo Hello
Unauthorized. (Different gsudo.exe?) Error: Failed to substitute token. Connection from server lost.

Screenshots

Context:

  • gsudo version: Any below or equal to 2.4.0

Reference: ddev/ddev#5324