Fix invalid handling of comma-separated mach modes - #1294
Merged
Conversation
(cherry picked from commit d83f228d4681631a129540ee0506386617e31194)
Robert Wojciechowski (robertwoj-microsoft)
requested review from
a team
as code owners
July 24, 2026 11:06
Daniel Szot (danielszot)
approved these changes
Jul 28, 2026
Krzysztof Kanas (kkanas)
enabled auto-merge (squash)
August 5, 2026 12:28
5 tasks
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.
Description
Fix improper handling of comma-separated mach modes.
Root cause
Contents of the pattern were passed directly to the
sshdcommand:sshd -T -C user=*@*,<guid>. The semantics is that the patterns are comma-separated and consittute an alternative of matches. Thesshdcommand though, expects only a single parameter: either*@*or<guid>.The fix
Now the code splits the pattern by the comma character and tries
sshd -T -C user=<param>command for each parsed parameter. Compliance is determined by combining all the patterns to not leave room for missed settings. For example, if we checked only the first pattern, we could miss settings for the users that have GUID as username in this case.Additional changes
As now for each parameter we check the same setting, I added the parameter context to the indicators to distinguish them. In the original IcM scenario we could have 2 indicators with the same message.
Checklist
devbranch prior to this PR submission.devbranch.