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§
type Reaper: TreeReaper
Required Methods§
Sourcefn detach(&self, cmd: &mut Command)
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.
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".