Fix: Update plan9 registration with the new default uid after OOBE#40977
Fix: Update plan9 registration with the new default uid after OOBE#40977chemwolf6922 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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
DefaultUidis known). - Skip Plan9 connection-target registration while OOBE is still pending for the distro.
- Extend
ModernOOBEunit test coverage to verify\\wsl.localhostaccess 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. |
|
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. |
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
\\wsl.localhostcreate files owned by root (UID 0) instead of WSL default user #40941Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Updated the test UnitTests::UnitTests::ModernOOBE to verify this change.