Retain bounded SYSTEM script failure metadata and verified execution context; keep historical Unknown unchanged
Rust development slice / linux (push) Failing after 10s
Rust development slice / linux (push) Failing after 10s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! Bounded Windows child process trees. No authorization is conferred here.
|
||||
//! The caller must commit the verified grant/attempt consumption before run.
|
||||
//! Job and handle lists are applied atomically by CreateProcessW (Windows 10+).
|
||||
use anyhow::{Result, ensure};
|
||||
use anyhow::{Context, Result, ensure};
|
||||
use std::{
|
||||
ffi::{OsStr, OsString},
|
||||
mem::{size_of, size_of_val, zeroed},
|
||||
@@ -316,8 +316,7 @@ pub(crate) fn run_observed(
|
||||
!cancel.load(Ordering::SeqCst),
|
||||
"PROCESS_CANCELLED_BEFORE_START"
|
||||
);
|
||||
ensure!(
|
||||
unsafe {
|
||||
let created = unsafe {
|
||||
CreateProcessW(
|
||||
application.as_ptr(),
|
||||
command.as_mut_ptr(),
|
||||
@@ -330,9 +329,10 @@ pub(crate) fn run_observed(
|
||||
&startup.StartupInfo,
|
||||
&mut process,
|
||||
)
|
||||
} != 0,
|
||||
"PROCESS_CREATION_REFUSED"
|
||||
);
|
||||
};
|
||||
if created == 0 {
|
||||
return Err(std::io::Error::last_os_error()).context("PROCESS_CREATION_REFUSED");
|
||||
}
|
||||
let process_handle = owned(process.hProcess)?;
|
||||
let _thread = owned(process.hThread)?;
|
||||
// Handles not explicitly listed (including job, DB and keys) are never inherited.
|
||||
|
||||
Reference in New Issue
Block a user