Struct privdrop::PrivDrop [−][src]
pub struct PrivDrop { /* fields omitted */ }
PrivDrop
structure
Example
ⓘThis example is not tested
privdrop::PrivDrop::default() .chroot("/var/empty") .user("nobody").unwrap() .apply() .unwrap_or_else(|e| { panic!("Failed to drop privileges: {}", e) });
Methods
impl PrivDrop
[src]
impl PrivDrop
pub fn chroot<T: AsRef<Path>>(self, path: T) -> Self
[src]
pub fn chroot<T: AsRef<Path>>(self, path: T) -> Self
chroot() to a specific directory before switching to a non-root user
pub fn user(self, user: &str) -> Result<Self, PrivDropError>
[src]
pub fn user(self, user: &str) -> Result<Self, PrivDropError>
Set the name of a user to switch to
pub fn group(self, group: &str) -> Result<Self, PrivDropError>
[src]
pub fn group(self, group: &str) -> Result<Self, PrivDropError>
Set a group name to switch to, if different from the primary group of the user
pub fn apply(self) -> Result<(), PrivDropError>
[src]
pub fn apply(self) -> Result<(), PrivDropError>
Apply the changes
Trait Implementations
impl Default for PrivDrop
[src]
impl Default for PrivDrop
impl Clone for PrivDrop
[src]
impl Clone for PrivDrop
fn clone(&self) -> PrivDrop
[src]
fn clone(&self) -> PrivDrop
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for PrivDrop
[src]
impl Debug for PrivDrop