https://github.com/freaky/unprivileged
Privilege dropping for Rust
https://github.com/freaky/unprivileged
Last synced: about 1 month ago
JSON representation
Privilege dropping for Rust
- Host: GitHub
- URL: https://github.com/freaky/unprivileged
- Owner: Freaky
- Created: 2019-07-17T02:31:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-17T02:40:09.000Z (almost 7 years ago)
- Last Synced: 2025-03-02T20:30:39.332Z (about 1 year ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unprivileged
Privilege dropping for Rust.
Currently supports Unix user/group changes (including supplementary groups),
and chroot, with vague aspirations for more.
```rust
use unprivileged::unix::{User, Chroot, PrivDrop};
let user = User::from("nobody"); // also User::default();
let chroot = Chroot::from("/var/empty"); // also Chroot::default();
user.apply()?;
chroot.apply()?;
// or...
let mut priv = PrivDrop::new();
priv.user("nobody")
.chroot("/var/empty");
priv.apply()?;
```
## See Also
Crates actually worth using at this point:
rusty-sandbox, privdrop, clap-permission-flag, capsicum, pledge.