Function privilege_rs::privilege_request

source ยท
pub fn privilege_request()
Expand description

Check current privilege:

  • If Root/Suid privilege -> donothing
  • If User privilege -> password request and re-run the application.
Examples found in repository?
examples/sudo.rs (line 4)
3
4
5
6
7
fn main() {
    privilege_request();

    println!("Run the application with sudo privilege!!!");
}