Skip to content

Modify CreateRestrictedToken to use better pattern#40453

Merged
benhillis merged 1 commit into
masterfrom
user/bperkins/update_create_restricted_token
May 7, 2026
Merged

Modify CreateRestrictedToken to use better pattern#40453
benhillis merged 1 commit into
masterfrom
user/bperkins/update_create_restricted_token

Conversation

@Brian-Perkins
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Switch CreateRestrictedToken to a newer pattern for consistency.

Detailed Description of the Pull Request / Additional comments

Use the CreateSid wrapper and only pass the size of the token information class to SetTokenInformation.

Validation Steps Performed

Manually started WSL

Copilot AI review requested due to automatic review settings May 7, 2026 17:55
@Brian-Perkins Brian-Perkins requested a review from a team as a code owner May 7, 2026 17:55
Copy link
Copy Markdown
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

Updates WSL’s restricted-token creation logic to align with the shared SID-construction helper and to use a consistent SetTokenInformation sizing pattern within the Windows security utilities.

Changes:

  • Replaced manual SID buffer/RtlInitializeSidEx usage with the existing CreateSid(...) helper when setting token integrity level.
  • Updated SetTokenInformation(TokenIntegrityLevel, ...) to pass sizeof(TOKEN_MANDATORY_LABEL) for the token information length.

@benhillis benhillis enabled auto-merge (squash) May 7, 2026 19:11
@benhillis benhillis merged commit d56c3d1 into master May 7, 2026
15 checks passed
@benhillis benhillis deleted the user/bperkins/update_create_restricted_token branch May 7, 2026 19:29
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.

4 participants