gsudo
gsudo copied to clipboard
Feature: Force elevation in new window
One way to ensure UIPI isolation is to elevate in a new window. If a user wants to ensure UIPI is respected is to force all elevations in new windows. To achieve this the user could do gsudo config ForceNewWindow true
, and then all subsequent elevations would been done in new windows.
It is desired that a batch/script that uses gsudo would produce the same outcome (but without breaking uipi) even if ForceNewWindow
is true or false. Unfortunatelly 'gsudo' currently doesn't know if it was called from a script or an interactive shell, and I doubt it could or should tell the difference.
Problems:
- Output capturing: would break
- Fast commands may open a new window, then close immediately. For example
gsudo -n dir
orgsudo cmd /k dir
- Previous item could be fixed by opening cmd /k {command} instead of cmd /c (i.e. ´gsudo -n cmd /k dir´) but that would then break (change the outcome) of scripts using gsudo
I have trouble finding an spec for this that fits all. Feedback wanted. But gsudo config SecurityEnforceUacIsolation true
IMHO is easier to understand and does not break scripts.
Completed in #190
Features:
-
Added setting
gsudo config NewWindow.Force
to force every elevation in new window. Same as using-n
every time. -
Added
--KeepShell
: Keep elevated shell open after running {command}. -
Added
--KeepWindow
: When in new console, ask for keypress before closing the console. -
Added setting
gsudo config NewWindow.CloseBehaviour
:OsDefault
,KeepShellOpen
(--KeepShell),PressKeyToClose
(--KeepWindow) -
Config syntax more relaxed now:
gsudo.exe config loglevel debug
gsudo.exe config loglevel=debug
gsudo.exe config loglevel="debug"
gsudo.exe config loglevel = debug
Released in v2.0.0 => https://gerardog.github.io/gsudo/docs/tips/elevation-in-new-window