https://github.com/tuemb/privilege-rs
A Rust crate for privilege request UI using eframe
https://github.com/tuemb/privilege-rs
privilege-escalation rust-crate sudo
Last synced: 8 months ago
JSON representation
A Rust crate for privilege request UI using eframe
- Host: GitHub
- URL: https://github.com/tuemb/privilege-rs
- Owner: TuEmb
- Created: 2024-09-16T04:46:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-18T09:31:58.000Z (over 1 year ago)
- Last Synced: 2025-05-29T18:40:08.329Z (10 months ago)
- Topics: privilege-escalation, rust-crate, sudo
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Overview
- **privilege-rs** provides a simple and lightweight user interface for privilege escalation using the eframe GUI library. This crate is designed to facilitate requesting root privileges on Linux systems by prompting users to enter their root or admin password through a graphical interface.
# Features
- Lightweight UI for password entry using eframe.
- Automatic privilege detection.
- Secure password handling and verification.
- Re-runs the application with elevated privileges when necessary.
# Example:
- Add to your `Cargo.toml`:
```
[dependencies]
privilege-rs = "0.1.3"
```
- In your `main.rs`:
```
fn main() {
if let Ok(privilege) = privilege_request() {
match privilege {
privilege_rs::Privilege::Root => {
println!("Run the application as Root privilege");
},
privilege_rs::Privilege::User => {
println!("Failed to request privilege");
},
privilege_rs::Privilege::Suid => {
println!("Run the application as Root privilege");
},
}
}
}
```