Struct privdrop::PrivDrop
[−]
[src]
pub struct PrivDrop { /* fields omitted */ }
PrivDrop structure
Example
PrivDrop::default().chroot("/var/empty").user("_appuser").apply().unwrap();
Methods
impl PrivDrop
[src]
fn chroot<T: AsRef<Path>>(self, path: T) -> Self
chroot() to a specific directory before switching to a non-root user
fn user<T: AsRef<str>>(self, user: T) -> Self
Set the name of a user to switch to
fn group<T: AsRef<str>>(self, group: T) -> Self
Set a group name to switch to, if different from the primary group of the user
fn apply(self) -> Result<(), PrivDropError>
Apply the changes