pub struct PrivDrop { /* private fields */ }
Expand description
Implementations§
source§impl PrivDrop
impl PrivDrop
sourcepub fn chroot<T: AsRef<Path>>(self, path: T) -> Self
pub fn chroot<T: AsRef<Path>>(self, path: T) -> Self
chroot() to a specific directory before switching to a non-root user
sourcepub fn group<S: AsRef<OsStr>>(self, group: S) -> Self
pub fn group<S: AsRef<OsStr>>(self, group: S) -> Self
Set a group name to switch to, if different from the primary group of the user
sourcepub fn include_default_supplementary_groups(self) -> Self
pub fn include_default_supplementary_groups(self) -> Self
Include default supplementary groups
sourcepub fn fallback_to_ids_if_names_are_numeric(self) -> Self
pub fn fallback_to_ids_if_names_are_numeric(self) -> Self
If a name is not found, try to parse it as a numeric identifier
sourcepub fn group_list<S: AsRef<OsStr>>(self, group_list: &[S]) -> Self
pub fn group_list<S: AsRef<OsStr>>(self, group_list: &[S]) -> Self
Set the full list of groups to switch to
sourcepub fn apply(self) -> Result<(), PrivDropError>
pub fn apply(self) -> Result<(), PrivDropError>
Apply the changes
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PrivDrop
impl Send for PrivDrop
impl Sync for PrivDrop
impl Unpin for PrivDrop
impl UnwindSafe for PrivDrop
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more