Add test coverage for custom groups and fail with ERROR_NOT_SUPPORTED…#14173
Open
OneBlue wants to merge 2 commits intofeature/wsl-for-appsfrom
Open
Add test coverage for custom groups and fail with ERROR_NOT_SUPPORTED…#14173OneBlue wants to merge 2 commits intofeature/wsl-for-appsfrom
OneBlue wants to merge 2 commits intofeature/wsl-for-appsfrom
Conversation
… for root ns processes
OneBlue
commented
Feb 7, 2026
| THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_INVALID_STATE), !m_processExitThread.joinable()); | ||
|
|
||
| THROW_WIN32_IF_MSG( | ||
| ERROR_NOT_SUPPORTED, Options.User != nullptr, "Custom users are not supported for root namespace processes"); |
Collaborator
Author
There was a problem hiding this comment.
We can add support later if there's a usecase for it. For now let's fail with a proper error code
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves WSLA coverage and behavior around custom user/group handling by adding tests for specifying a custom group in containers/exec, and by making root-namespace process creation explicitly fail when a custom user is requested.
Changes:
- Added a root-namespace-process negative test validating
SetUser(...)fails withERROR_NOT_SUPPORTED. - Added test coverage verifying
user:groupis applied correctly for container init processes andexec. - Added a service-side guard returning
ERROR_NOT_SUPPORTEDwhenWSLA_PROCESS_OPTIONS::Useris specified for root-namespace processes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/windows/WSLATests.cpp | Adds new tests for custom group wiring (container init + exec) and an error-path test for root-namespace processes. |
| src/windows/wslaservice/exe/WSLAVirtualMachine.cpp | Enforces ERROR_NOT_SUPPORTED when Options.User is provided for root-namespace process creation. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
benhillis
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… for root ns processes
Summary of the Pull Request
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed