Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 20 fields pub root: Vec<u8>, pub bindings: Vec<Binding>, pub cwd: Vec<u8>, pub cwd_default: bool, pub kill_on_exit: bool, pub verbose: i32, pub command: Vec<CString>, pub env: Option<Vec<CString>>, pub kernel_release: Option<Vec<u8>>, pub fake_root: bool, pub threads: usize, pub spin_us: u64, pub cleanup_dirs: Vec<Vec<u8>>, pub seccomp_programs: Vec<Vec<u8>>, pub info_fds: Vec<i32>, pub json_status_fds: Vec<i32>, pub new_session: bool, pub hostname: Option<Vec<u8>>, pub argv0: Option<CString>, pub bwrap_mode: bool,
}
Expand description

Everything the launcher needs to start the traced command.

Fields§

§root: Vec<u8>

Host directory used as the guest /.

§bindings: Vec<Binding>

Bind mounts, in command-line order; later entries win on equal prefix.

§cwd: Vec<u8>

Initial working directory, as a guest path.

§cwd_default: bool

cwd was not given on the command line: it is the caller’s working directory, to be kept only where the guest can see it.

§kill_on_exit: bool

Kill every tracee when the supervisor exits.

§verbose: i32

Verbosity, 0 is quiet.

§command: Vec<CString>

Command and arguments to run inside the guest; argv[0] first.

§env: Option<Vec<CString>>

Environment for the command, or None to inherit the supervisor’s.

§kernel_release: Option<Vec<u8>>

Value reported by uname(2) in the release field, if faked.

§fake_root: bool

Pretend to be root (fake_id0). Accepted but not implemented yet.

§threads: usize

Number of supervisor threads answering seccomp notifications.

§spin_us: u64

Microseconds a supervisor thread spins before parking.

§cleanup_dirs: Vec<Vec<u8>>

Directories to remove recursively once the tracer returns (bwrap mode).

§seccomp_programs: Vec<Vec<u8>>

Extra classic-BPF seccomp programs (raw sock_filter bytes) the first tracee installs after ours (bwrap --seccomp/--add-seccomp-fd).

§info_fds: Vec<i32>

Descriptors that receive {"child-pid": N} once the child is forked (bwrap --info-fd).

§json_status_fds: Vec<i32>

Descriptors that receive {"child-pid": N} and later {"exit-code": N} (bwrap --json-status-fd).

§new_session: bool

Run the command in a new session (bwrap --new-session).

§hostname: Option<Vec<u8>>

Hostname to report (bwrap --hostname). Not applied yet.

§argv0: Option<CString>

argv[0] to give the command when it differs from command[0] (bwrap --argv0).

§bwrap_mode: bool

Invoked through the bubblewrap front end: failures are worded as bwrap words them.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Builds the configuration equivalent to running proot with no option.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.