Add fresh device trust, installer recovery and scoped patch runtime

This commit is contained in:
2026-11-17 16:08:53 +01:00
parent 60f8f21f54
commit 81fcd9c8f8
24 changed files with 543 additions and 45 deletions
+18 -4
View File
@@ -1430,6 +1430,13 @@ impl Server {
}
}
/// Blocking SDK call; run on the agent's bounded blocking worker, never heartbeat reactor.
pub fn execution_timeout(action: &rmm_domain::jobs::Action, seconds: u32) -> Result<Duration> {
ensure!(
(1..=action.windows_system_runtime_limit(120, Some(rmm_domain::jobs::WINDOWS_UPDATE_MAX_SECONDS))).contains(&seconds),
"SYSTEM_EXECUTION_TIMEOUT_BOUND"
);
Ok(Duration::from_secs(u64::from(seconds) + 5))
}
pub fn exchange(pin: &Pin, call: &Call, timeout: Duration) -> Result<Reply> {
exchange_fixed(pin, call, timeout, false)
}
@@ -1443,10 +1450,17 @@ fn exchange_fixed(pin: &Pin, call: &Call, timeout: Duration, time_only: bool) ->
);
pin.validate()?;
require_self(&pin.agent).context(Stage::ClientSelfRole)?;
ensure!(
(Duration::from_secs(1)..=Duration::from_secs(125)).contains(&timeout),
"HELPER_CALL_TIMEOUT_BOUND"
);
if timeout > Duration::from_secs(125) {
let Operation::Execute { request, .. } = &call.operation else {
anyhow::bail!("HELPER_CALL_TIMEOUT_BOUND");
};
let job = pin.binding.job(&request.job_bytes)?;
ensure!(job.execution_identity == "system" && job.action.is_windows_update_template()
&& execution_timeout(&job.action, job.max_runtime_seconds)? == timeout,
"HELPER_CALL_TIMEOUT_BOUND");
} else {
ensure!(timeout >= Duration::from_secs(1), "HELPER_CALL_TIMEOUT_BOUND");
}
let deadline = Instant::now() + timeout;
let pipe = owned(unsafe {
CreateFileW(