super-shell

Crates.iosuper-shell
lib.rssuper-shell
version1.2.4
sourcesrc
created_at2023-07-24 11:45:27.064344
updated_at2024-03-31 19:45:52.752705
descriptionThis library provides basic super-user shell access in rust.
homepagehttps://github.com/RouHim/super-shell-rs
repositoryhttps://github.com/RouHim/super-shell-rs
max_upload_size
id924513
size886,383
Rouven Hi! (RouHim)

documentation

README

This library provides basic super-user shell access in rust.

Example usage

use super_shell::RootShell;

fn main() {
    // Super user privileges are requested once via pkexec as default.
    let mut root_shell = RootShell::new().expect("Failed to create root shell");
    
    // All subsequent requests are executed as root user
    println!("{}", root_shell.execute("echo Hello $USER"));
    
    // Each command blocks until the response is fully received
    println!("{}", root_shell.execute("echo now sleeping for 3s ..."));
    root_shell.execute("sleep 3");
    println!("done")
}

Limitations

  • Currently only Linux is supported
  • No stderr handling
  • No sudo support
Commit count: 38

cargo fmt