Closed
Description
The disk-hygiene engine's Windows live-handle probe (windows_handle_state) reports a path as clear while another process holds it open.
Evidence
Found while preparing the #5229 UAC pilot (2026-10-01, melo-desk-001, Windows Python via ctypes). A repro with the same CreateFileW shape the engine uses (desired access 0, share mode 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL):
- While another handle held the file open (a plain Python
open, and an exclusive read/write hold), the probe opened successfully (returned 0, "clear"). - The same open asking for
DELETEaccess (0x10000) returned win32 error 32 (sharing violation), as expected.
Opening with zero desired access does not conflict with existing share modes, so it cannot detect a live handle. handoff-verify on Windows can therefore report clear for a locked path, which contradicts the safety model's "an exclusive-open probe finding no live handle" condition.
Ask
- Change the probe to request the access the removal needs (
DELETE) with share mode 0, and treat win32 32/33 aslocked. - Add a Windows regression test that holds a handle open and asserts
locked, and fails on the current probe. - Correct
safety-model.mdif any claim rested on the old probe; bump disk-hygiene with a CHANGELOG entry.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
No fields configured for issues without a type.
Activity
docs(disk-hygiene): record the verification of the Win32 handle-probe…