Skip to content

Impersonate caller in ResizeDistribution VHD operations#40253

Merged
benhillis merged 1 commit intomasterfrom
user/benhillis/resize-impersonation
Apr 22, 2026
Merged

Impersonate caller in ResizeDistribution VHD operations#40253
benhillis merged 1 commit intomasterfrom
user/benhillis/resize-impersonation

Conversation

@benhillis
Copy link
Copy Markdown
Member

@benhillis benhillis commented Apr 20, 2026

Add scoped wil::CoImpersonateClient() around VHD file operations in ResizeDistribution so that file access is checked against the calling user's permissions rather than running as SYSTEM. Both the grow and shrink paths are covered. VM operations remain as SYSTEM.

Add scoped wil::CoImpersonateClient() around VHD file operations in
ResizeDistribution so that file access is checked against the calling
user's permissions rather than running as SYSTEM. Both the grow and
shrink paths are covered. VM operations remain as SYSTEM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 20:29
@benhillis benhillis requested a review from a team as a code owner April 20, 2026 20:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 the WSL service’s ResizeDistribution implementation to perform host-side VHD open/size/resize operations while impersonating the COM caller, ensuring the underlying VHD file access is evaluated against the calling user’s permissions instead of SYSTEM.

Changes:

  • Added scoped wil::CoImpersonateClient() around VHD open/size/resize calls in both grow and shrink paths.
  • Refactored local variables (configuration const, vhdPath alias) to reuse the resolved VHD path consistently.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@benhillis benhillis merged commit 3a675eb into master Apr 22, 2026
17 checks passed
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