Enum unshare::Error [] [src]

pub enum Error {
    NixError,
    UnknownError,
    CreatePipe(i32),
    Fork(i32),
    Exec(i32),
    Chdir(i32),
    ParentDeathSignal(i32),
    PipeError(i32),
    WaitError(i32),
    StdioError(i32),
    SetUser(i32),
    ChangeRoot(i32),
    SetIdMap(i32),
    AuxCommandExited(i32),
    AuxCommandKilled(i32),
    SetPGid(i32),
    SetNs(i32),
}

Error runnning process

This type has very large number of options and it's enum only to be compact. Probably you shouldn't match on the error cases but just format it for user into string.

Variants

Unknown nix error

Frankly, this error should not happen when running process. We just keep it here in case nix returns this error, which should not happen.

Some invalid error code received from child application

Error happened when we were trying to create pipe. The pipes used for two purposes: (a) for the process's stdio (Stdio::pipe() or Stdio::null()), (b) internally to wake up child process and return error back to the parent.

Error when forking/cloning process

Error when running execve() systemcall

Error when setting working directory specified by user

Unable to set death signal (probably signal number invalid)

Error reading/writing through one of the two signal pipes

Error waiting for process (for some functions only, for example Command::status()). It probably means someone already waited for the process, for example it might be other thread, or signal handler.

Error setting up stdio for process

Could not set supplementary groups, group id or user id for the process

Error changing root, it explains chroot, pivot_root system calls and setting working directory inside new root. Also includes unmounting old file system for pivot_root case.

Error setting uid or gid map. May be either problem running newuidmap/newgidmap command or writing the mapping file directly

Auxillary command failed

There are two auxillary commands for now: newuidmap and newgidmap. They run only when uid mappings (user namespaces) are enabled.

Note that failing to run the binary results to SedIdMap(sys_errno), this error contains status code of command that was succesfullly spawned.

Auxillary command was killed by signal

Similar to AuxCommandExited but when command was killed

Error when calling setpgid function

Error when calling setns syscall

Methods

impl Error
[src]

Similarly to io::Error returns bare error code

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl Clone for Error
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl StdError for Error
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl Display for Error
[src]

Formats the value using the given formatter. Read more