Skip to content

Add test coverage for custom groups and fail with ERROR_NOT_SUPPORTED…#14173

Open
OneBlue wants to merge 2 commits intofeature/wsl-for-appsfrom
user/oneblue/groups
Open

Add test coverage for custom groups and fail with ERROR_NOT_SUPPORTED…#14173
OneBlue wants to merge 2 commits intofeature/wsl-for-appsfrom
user/oneblue/groups

Conversation

@OneBlue
Copy link
Collaborator

@OneBlue OneBlue commented Feb 7, 2026

… for root ns processes

Summary of the Pull Request

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@OneBlue OneBlue requested a review from a team as a code owner February 7, 2026 01:48
Copilot AI review requested due to automatic review settings February 7, 2026 01:48
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");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can add support later if there's a usecase for it. For now let's fail with a proper error code

Copy link
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 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 with ERROR_NOT_SUPPORTED.
  • Added test coverage verifying user:group is applied correctly for container init processes and exec.
  • Added a service-side guard returning ERROR_NOT_SUPPORTED when WSLA_PROCESS_OPTIONS::User is 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>
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.

2 participants