Skip to content

fix: add support for preserving quoted group names in sshd_config#1639

Open
Gijsreyn wants to merge 1 commit into
PowerShell:mainfrom
Gijsreyn:gh-1508/main/fix-space-sshd
Open

fix: add support for preserving quoted group names in sshd_config#1639
Gijsreyn wants to merge 1 commit into
PowerShell:mainfrom
Gijsreyn:gh-1508/main/fix-space-sshd

Conversation

@Gijsreyn

Copy link
Copy Markdown
Collaborator

PR Summary

Fixes a bug where sshd_config list keywords with quoted, space-containing values (e.g. the Windows group "openssh users") were split into separate entries on export and get.

PR Context

Fixes #1508.

Copilot AI review requested due to automatic review settings July 21, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a Windows-specific parsing/export bug in the Microsoft.OpenSSH.SSHD/sshd_config resource where space-containing, quoted list entries (e.g. AllowGroups administrators "openssh users") were incorrectly split into separate items during get and export.

Changes:

  • Added a Pester test that verifies get and export preserve quoted group names containing spaces.
  • Updated get_sshd_settings() to prefer explicitly-parsed config-file values for space-separated multi-arg keywords (avoiding sshd -T quote-stripping/splitting behavior).
  • Added Rust unit tests covering the new override behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
resources/sshdconfig/tests/sshdconfig.get.tests.ps1 Adds coverage ensuring quoted group values remain a single array entry for both get and export.
resources/sshdconfig/src/get.rs Restores correct list semantics by overriding sshd -T-normalized values with explicitly parsed config values for affected keywords.

@Gijsreyn
Gijsreyn force-pushed the gh-1508/main/fix-space-sshd branch from 0faeeaf to 9b7da04 Compare July 21, 2026 03:06
@Gijsreyn

Copy link
Copy Markdown
Collaborator Author

@tgauth - is this something you can take a quick look at?

@tgauth

tgauth commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks for opening this! My initial thoughts are that this issue is applicable to other arguments that can have spaces as well (i.e. regular arguments for paths) and I wonder if we can address those here as well. I'm going to think on it a bit and see if there's a good way to do that, and if not, we can defer it to a future PR.

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.

In Microsoft.OpenSSH.SSHD/sshd_config allowgroups is not processed correctly

3 participants