Expand description
Detect if you are running as root, restart self with sudo
if needed or setup uid zero when running with the SUID flag set.
§Requirements
- The
sudo
program is required to be installed and setup correctly on the target system. - Linux or Mac OS X tested
- It should work on *BSD. However, you can also create an Escalate builder with
doas
as the wrapper should you prefer that.
- It should work on *BSD. However, you can also create an Escalate builder with
Structs§
Enums§
- Running
As - Cross platform representation of the state the current program running
Functions§
- builder
- Alias for Escalate::builder() to quickly create a new karen Escalate builder
- check
- Check getuid() and geteuid() to learn about the configuration this program is running under
- doas
- Similar to escalate_if_needed, but with doas as the wrapper
- escalate_
if_ needed - Restart your program with sudo if the user is not privileged enough.
- pkexec
- Similar to escalate_if_needed, but with pkexec as the wrapper
- with_
env - Escalate privileges while maintaining RUST_BACKTRACE and selected environment variables (or none).