use is_sudo::check;
use is_sudo::RunningAs;
fn main() {
let running_as: RunningAs = is_sudo::check();
match running_as {
RunningAs::Root => println!("Running as root"),
RunningAs::User => println!("Running as user"),
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Checks whether the process is running as root/sudo/admin permission in Windows and Unix systems
spa5k/is_sudo
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Checks whether the process is running as root/sudo/admin permission in Windows and Unix systems
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published