rootless-run 0.1.0

Rootless execution of commands that require root
Documentation
# rootless-run 🫚🚫🏃‍➡️

A [Rust] library for the execution of commands as root without being root.

Currently, it supports [fakeroot] and [rootlesskit].

## Documentation

Refer to <https://docs.rs/rootless-run/latest/rootless_run/> for released versions of the crate.

## Examples

### Library

```rust
use rootless_run::{
    FakerootBackend,
    FakerootOptions,
    RootlessBackend,
    RootlesskitBackend,
    RootlesskitOptions,
};
# use rootless_run::detect_virt;

# fn main() -> testresult::TestResult {
// Create a fakeroot backend with default options.
let backend = FakerootBackend::new(FakerootOptions::default());

// Call `whoami` using fakeroot and return its output.
let output = backend.run(&["whoami"])?;

assert_eq!("root\n", String::from_utf8_lossy(&output.stdout));

# let virt = detect_virt()?;
# if !virt.uses_namespaces() {
// Create a rootlesskit backend with default options.
let backend = RootlesskitBackend::new(RootlesskitOptions::default());

// Call `whoami` using rootlesskit and return its output.
let output = backend.run(&["whoami"])?;

assert_eq!("root\n", String::from_utf8_lossy(&output.stdout));
# }
# Ok(())
# }
```

## Contributing

Please refer to the [contribution guidelines] to learn how to contribute to this project.

## Releases

Releases are created by the developers of this project.

[OpenPGP certificates] with the following [OpenPGP fingerprints] can be used to verify signed tags:

- [`991F6E3F0765CF6295888586139B09DA5BF0D338`] [David Runge] &lt;<dvzrv@archlinux.org>&gt;
- [`165E0FF7C48C226E1EC363A7F83424824B3E4B90`] [Orhun Parmaksız] &lt;<orhun@archlinux.org>&gt;

Some of the above are part of [archlinux-keyring] and certified by at least three [main signing keys] of the distribution.
All certificate are cross-signed and can be retrieved from [OpenPGP keyservers].

## License

This project can be used under the terms of the [Apache-2.0] or [MIT].
Contributions to this project, unless noted otherwise, are automatically licensed under the terms of both of those licenses.

[Apache-2.0]: LICENSES/Apache-2.0.txt
[David Runge]: https://archlinux.org/people/developers/#dvzrv
[MIT]: LICENSES/MIT.txt
[OpenPGP certificates]: https://openpgp.dev/book/certificates.html
[OpenPGP fingerprints]: https://openpgp.dev/book/certificates.html#fingerprint
[OpenPGP keyservers]: https://wiki.archlinux.org/title/OpenPGP#Keyserver
[Orhun Parmaksız]: https://archlinux.org/people/package-maintainer/#orhun
[Rust]: https://www.rust-lang.org/
[`165E0FF7C48C226E1EC363A7F83424824B3E4B90`]: https://pgpkeys.eu/pks/lookup?search=165E0FF7C48C226E1EC363A7F83424824B3E4B90&fingerprint=on&op=index
[`991F6E3F0765CF6295888586139B09DA5BF0D338`]: https://pgpkeys.eu/pks/lookup?search=991F6E3F0765CF6295888586139B09DA5BF0D338&fingerprint=on&op=index
[archlinux-keyring]: https://gitlab.archlinux.org/archlinux/archlinux-keyring
[contribution guidelines]: CONTRIBUTING.md
[fakeroot]: https://man.archlinux.org/man/fakeroot.1
[main signing keys]: https://archlinux.org/master-keys/
[rootlesskit]: https://github.com/rootless-containers/rootlesskit