[−][src]Struct beach::Chroot
A wrapper for chroot(1)
.
Note: Running chroot
requires root privileges.
Examples
beach::Chroot::new() .user_group("nvzqz", "everyone") .command("/path/to/root", "ls") .arg("/") .spawn();
Methods
impl Chroot
[src]
pub const fn new() -> Self
[src]
Creates an instance suitable for setting up a Command
to execute a
program through chroot
.
pub fn skip_chdir(self) -> Self
[src]
Do not change the working directory to /
.
pub fn user<U>(self, user: U) -> Self where
U: AsRef<OsStr>,
[src]
U: AsRef<OsStr>,
Specify the user to use.
pub fn user_group<U, G>(self, user: U, group: G) -> Self where
U: AsRef<OsStr>,
G: AsRef<OsStr>,
[src]
U: AsRef<OsStr>,
G: AsRef<OsStr>,
Specify the user and group (ID or name) to use.
pub fn groups<G>(self, groups: G) -> Self where
G: IntoIterator,
G::Item: AsRef<OsStr>,
[src]
G: IntoIterator,
G::Item: AsRef<OsStr>,
Specifies supplementary groups.
pub fn command<R, P>(&self, root: R, program: P) -> Command where
R: AsRef<Path>,
P: AsRef<OsStr>,
[src]
R: AsRef<Path>,
P: AsRef<OsStr>,
Returns a Command
suitable for spawning program
with root
as /
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Chroot
impl Send for Chroot
impl Sync for Chroot
impl Unpin for Chroot
impl UnwindSafe for Chroot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,