Skip to content

wslc: Run saved state cleanup as user - #41259

Merged
benhillis merged 1 commit into
masterfrom
benhillis/saved-state-cleanup-user
Aug 5, 2026
Merged

wslc: Run saved state cleanup as user#41259
benhillis merged 1 commit into
masterfrom
benhillis/saved-state-cleanup-user

Conversation

@benhillis

Copy link
Copy Markdown
Member

Summary of the Pull Request

Runs VM saved-state file cleanup under the owning user's token, matching the context used when the file is created and accessed elsewhere.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

The saved-state path is created while running as the owning user. This change applies the same user context when checking and removing that file during VM teardown.

Validation Steps Performed

  • Built the full project with cmake --build . -- -m.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: eed677b2-73d4-445c-b738-16123e81897b
@benhillis
benhillis requested a review from a team as a code owner August 5, 2026 18:22
Copilot AI lite review requested due to automatic review settings August 5, 2026 18:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates WSL’s Windows service VM teardown path to perform saved-state file cleanup while impersonating the owning user, aligning deletion/access context with how the saved-state file is created and managed elsewhere in HcsVirtualMachine.

Changes:

  • Impersonate m_userToken before checking/removing the VM saved-state file during HcsVirtualMachine destruction.

@benhillis benhillis changed the title Run saved state cleanup as user wslc: Run saved state cleanup as user Aug 5, 2026
@benhillis
benhillis enabled auto-merge (squash) August 5, 2026 18:57
@benhillis
benhillis merged commit 2570b98 into master Aug 5, 2026
12 checks passed
@benhillis
benhillis deleted the benhillis/saved-state-cleanup-user branch August 5, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants