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
Trait Implementations
impl Default for PrivDrop
[src]
impl Clone for PrivDrop
[src]
fn clone(&self) -> PrivDrop
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more