Repository navigation
Conversation
The bar runs as admin and the installer does too; program() gave what they started a runas /trustlevel "basic user" token made from their admin one. That token reports itself elevated (High integrity) with the Administrators group deny-only, and UAC cannot raise it: an app started that way that asked for admin rights quietly got a copy without them. reshell and rs-launcher carried it after every install or update until the next sign-in, and so did rust-explorer opened from the bar or with Win+E. From a caller that is really admin, program() now borrows the token of the session's sihost.exe (Explorer's when it is missing), the token a program started from the desktop gets, through CreateProcessWithTokenW. Other callers keep runas /trustlevel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The bar runs as admin (its task has the highest run level) and so does the installer.
common::launch::programgave what they started arunas /trustlevel:0x20000token made from their admin one. That token says it is elevated (High integrity,TokenElevationTypeFull) while the Administrators group is deny-only, and UAC cannot raise it: an app started that way that asked for admin rights quietly got another copy without them (on a PC set to elevate without prompting; with a prompt it fails too). reshell and rs-launcher carried it after every install or update until the next sign-in, and so did rust-explorer opened from the bar or with Win+E.From a caller that really is admin (
IsUserAnAdmin),program()now borrows the token of the session's sihost.exe (Explorer's when it is missing) throughCreateProcessWithTokenW: the token a program started from the desktop gets, Medium integrity, a split token UAC can raise. rtaskmgr's profiles already start programs this way (sys::run_unelevated). Other callers keeprunas /trustlevel.Test
cargo test -p winrust-common