Repository navigation
feat(agent): support elevated NOW execution - #2191
Richard Markiewicz (thenextman) wants to merge 3 commits into
Conversation
Let maintainers know that an action is required on their side
|
|
Draft for review; Windows runtime validation remains outstanding. The Windows-target library and tests compile with Changed lines (additions / deletions):
Runtime review should cover consent granted/denied, channel loss or renegotiation during consent, elevated cancellation/abort failures, script lifetime, exit codes, and STARTED_NO_IO_REDIRECTION across supported execution styles. Elevated processes are not assigned to the channel job and may outlive their channel. The touched Run path retains an existing UNTESTED property: the directory buffer must remain alive through ShellExecuteW because consuming it would leave a dangling pointer; successful launches cannot establish pointer validity. Note LLM-assisted content (no human feedback). |
There was a problem hiding this comment.
🟡 Changes recommended
Stale worker notifications after capability renegotiation can remove newly reused sessions and report the wrong execution’s outcome.
4 open issues
What changed in this PR
Adds Windows UAC elevation support to NOW execution in the session host, using now-proto-pdu 0.5.0.
Changes:
- Negotiates elevation for Run, Process, Batch, Windows PowerShell, and PowerShell 7 requests.
- Adds asynchronous elevated launches, consent-denial reporting, and unavailable-stdio signaling.
- Tracks attached elevated process exit codes and retains temporary scripts during execution.
| File | Description |
|---|---|
devolutions-session/src/dvc/task.rs |
Negotiates elevation and routes elevated execution requests. |
devolutions-session/src/dvc/process.rs |
Implements elevated launches, notifications, and process lifetime handling. |
devolutions-session/src/dvc/now_message_dissector.rs |
Adapts decode-error handling to the updated dependency API. |
devolutions-session/Cargo.toml |
Updates now-proto-pdu to 0.5.0. |
crates/win-api-wrappers/src/process.rs |
Adds process-ID lookup and adjusts shell execution support. |
Cargo.lock |
Locks the protocol upgrade and consolidates IronRDP dependencies. |
Review effort: Balanced
|
Addressed all four Copilot findings in 59bda9a and requested another review. Each negotiation now has its own notification channel, elevated process cleanup retains scripts until exit, cancellation errors are reported without ending process monitoring, and known elevation failures use portable NOW statuses while ordinary launch failures retain platform errors. Current PR line counts: production Rust +415/-91; tests +217/-6; manifests and lockfile +22/-37. Windows-target Clippy with warnings denied, formatting, and oracle-marker checks pass locally. The new Windows regression tests are compiled but have not run locally; CI is running. Interactive UAC consent, credential prompts, and real cross-integrity cancellation still need Windows runtime verification; the lifecycle tests use ordinary Windows child processes to exercise cleanup and cancellation-failure handling without prompting for elevation. Note LLM-assisted content (no human feedback). |


Support elevated NOW execution through Windows UAC for Run, Process, Batch, Windows PowerShell, and PowerShell 7 using now-proto-pdu 0.5.0.
Negotiate elevation support, reject requests that cannot be elevated without falling back to standard execution, report denied consent, and signal unavailable stdio redirection. Track attached elevated process exit codes and retain script files while their processes run.