rustup-init should warn if user is elevated on Windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
Problem you are trying to solve
New users may expect an installer like rustup-init to need to be run as admin, so they elevate the process to admin. This can lead to problems when they then try to run with their standard user rights, either because of permissions or because it installed as a different user.
Solution you'd like
Detect if the user has elevated permissions and print a warning that this may not be what they want. Alternatively, instead of a warning maybe it could ask for confirmation?
Notes
It's possible this could be what's wanted so I don't think it should be a hard error.
This can be done using the GetTokenInformation function with the current process token to get the TOKEN_ELEVATION_TYPE. It will be set to TokenElevationTypeFull if the process is running with more rights than is the default for the user.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the rustup-init entry point and inspect the Windows-specific process-token handling. Read the linked GetTokenInformation and TOKEN_ELEVATION_TYPE documentation to determine how elevation is detected. Done means elevated users receive a warning or confirmation prompt, while the installer remains usable for cases where elevation is intentional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100