Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/windows_signer_preflight.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ try {
-WindowStyle Hidden -PassThru
if (-not $process.WaitForExit($TimeoutSeconds * 1000)) {
Stop-PreflightProcess $process
$process = $null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Confirm termination before clearing the process handle

When Windows signer inspection times out and taskkill itself exceeds five seconds, Stop-PreflightProcess kills taskkill and issues a silenced Stop-Process request but never waits for or rechecks the target's exit. Unconditionally clearing $process then prevents finally from retaining cleanup ownership, so a failed or asynchronous force-stop can leave the signer/provider running after Setup reports the timeout and can keep the redirected temporary files open. Only clear the handle after termination has been confirmed within the bounded cleanup period.

Useful? React with 👍 / 👎.

exit 2
}
[void]$process.WaitForExit()
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def test_windows_setup_wizard_is_native_offline_and_fail_closed():
assert "taskkill.exe" in preflight
assert "$killer.WaitForExit(5000)" in preflight
assert "Stop-Process -Id $killer.Id -Force" in preflight
assert "Stop-PreflightProcess $process\n $process = $null\n exit 2" in preflight


@pytest.mark.skipif(sys.platform != "win32", reason="Windows signer process contract")
Expand Down
Loading