Skip to content

Fix: Update plan9 registration with the new default uid after OOBE#40977

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

Fix: Update plan9 registration with the new default uid after OOBE#40977
chemwolf6922 wants to merge 4 commits into
masterfrom
user/chemwolf6922/fix-incorrect-share-uid-after-fresh-installation

Conversation

@chemwolf6922

@chemwolf6922 chemwolf6922 commented Jul 2, 2026

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 updates the plan9 registration after the OOBE completes with the new 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 Outdated
Comment thread src/windows/service/exe/WslCoreInstance.cpp Outdated
@benhillis

Copy link
Copy Markdown
Member

I'm not 100% sure this is the right fix. If OOBE doesn't run then we'll never start the plan9 server right?

Copilot AI review requested due to automatic review settings July 8, 2026 06:26
@chemwolf6922

Copy link
Copy Markdown
Contributor Author

I'm not 100% sure this is the right fix. If OOBE doesn't run then we'll never start the plan9 server right?

I changed it to an update approach. The drawback of this is that existing sessions still use the old uid after the update.

@chemwolf6922 chemwolf6922 changed the title Fix: delay plan9 registration after OOBE Fix: Update plan9 registration with the new default uid after OOBE Jul 8, 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/windows/common/Redirector.cpp
Comment thread src/windows/common/Redirector.cpp Outdated
Comment thread test/windows/UnitTests.cpp
Copilot AI review requested due to automatic review settings July 8, 2026 08:02

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/windows/common/Redirector.cpp
Comment thread src/windows/common/Redirector.cpp
Comment thread test/windows/UnitTests.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