Skip to main content

ProcessControl

Trait ProcessControl 

Source
pub trait ProcessControl: Sealed {
    type Reaper: TreeReaper;

    // Required methods
    fn detach(&self, cmd: &mut Command);
    fn new_reaper(&self) -> Result<Self::Reaper>;
}
Expand description

Two things Unix does with process groups and Windows does with job objects, behind one contract.

Required Associated Types§

Required Methods§

Source

fn detach(&self, cmd: &mut Command)

Detach the child from the controlling terminal or console so it cannot inject input into ours.

Unix: setsid() in pre_exec, which is the TIOCSTI defense. Windows: DETACHED_PROCESS, which closes the WriteConsoleInput-on-CONIN$ variant of the same attack. Different syscalls, same threat.

Source

fn new_reaper(&self) -> Result<Self::Reaper>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§