🐛 device/windows: restore disk read-only state, not online state#8664
Open
tas50 wants to merge 1 commit into
Open
🐛 device/windows: restore disk read-only state, not online state#8664tas50 wants to merge 1 commit into
tas50 wants to merge 1 commit into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
1ece206 to
b5c988f
Compare
Contributor
c1c8f89 to
d343c28
Compare
When a target disk was read-only, the manager cleared the read-only flag for scanning but recorded the action in diskSetToOnline instead of diskSetToReadonly. diskSetToReadonly was therefore never set, so UnmountAndClose never re-applied the disk's read-only protection — the disk was left writable after the scan — and the spurious diskSetToOnline caused cleanup to also flip the online/offline state that was never changed. Record the read-only change in diskSetToReadonly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015U1ocAxfcBhVYi3f9JnyZZ
d343c28 to
2d62edf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
connection/device/windows/device_manager.go:The read-only branch records its action in
diskSetToOnlineinstead ofdiskSetToReadonly.diskSetToReadonlyis therefore never set totrueanywhere, soUnmountAndClosenever restores the disk's read-only protection — the disk is left writable after the scan. Worse, the spuriousdiskSetToOnline = truemakes cleanup flip the online/offline state that was never changed.Fix
Record the read-only change in
diskSetToReadonlyso cleanup re-applies it. (Windows-only code path; verified by build — no mock harness exists for the disk-management PowerShell calls.)🤖 Generated with Claude Code
https://claude.ai/code/session_015U1ocAxfcBhVYi3f9JnyZZ
Generated by Claude Code