Skip to content

Fix: delay plan9 registration after OOBE#40977

Open
chemwolf6922 wants to merge 2 commits into
masterfrom
user/chemwolf6922/fix-incorrect-share-uid-after-fresh-installation
Open

Fix: delay plan9 registration after OOBE#40977
chemwolf6922 wants to merge 2 commits into
masterfrom
user/chemwolf6922/fix-incorrect-share-uid-after-fresh-installation

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Currently, after a fresh distro installation, operations in the linux plan9 share will use the uid 0. Because the uid was cached before the OOBE is complete. And this only recovers after a distro termination.
This PR delays the plan9 registration after the OOBE completes with the correct default uid.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Updated the test UnitTests::UnitTests::ModernOOBE to verify this change.

Copilot AI review requested due to automatic review settings July 2, 2026 09:36
@chemwolf6922 chemwolf6922 requested a review from a team as a code owner July 2, 2026 09:36
@chemwolf6922 chemwolf6922 changed the title Delay plan9 registration after OOBE Fix: delay plan9 registration after OOBE Jul 2, 2026

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 fixes a WSL2 Plan9/\\wsl.localhost ownership regression on fresh installs by deferring Plan9 redirector connection-target registration until after OOBE completes, so Windows-initiated file operations use the correct default UID instead of a pre-OOBE cached value (often UID 0).

Changes:

  • Register the Plan9 redirector connection target after successful OOBE completion (once DefaultUid is known).
  • Skip Plan9 connection-target registration while OOBE is still pending for the distro.
  • Extend ModernOOBE unit test coverage to verify \\wsl.localhost access is blocked pre-OOBE and that files created post-OOBE have the expected UID.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/windows/service/exe/WslCoreInstance.cpp Delays Plan9 connection-target registration until after successful OOBE, ensuring correct UID is used.
test/windows/UnitTests.cpp Updates ModernOOBE test to validate pre-/post-OOBE \\wsl.localhost behavior and resulting file ownership.

Comment thread src/windows/service/exe/WslCoreInstance.cpp
Comment thread src/windows/service/exe/WslCoreInstance.cpp
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