init file from sshd_config_default on Windows#1474
Open
tgauth wants to merge 6 commits intoPowerShell:mainfrom
Open
init file from sshd_config_default on Windows#1474tgauth wants to merge 6 commits intoPowerShell:mainfrom
tgauth wants to merge 6 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses #1469 by changing how the sshdconfig resource behaves when the target sshd_config file is missing—on Windows, it attempts to seed the file from the system’s sshd_config_default so subsequent subsystem-related operations don’t fail due to an empty/nonexistent config.
Changes:
- Added
ensure_sshd_config_exists()to seed a missingsshd_configfromsshd_config_defaulton Windows. - Updated
setflows to require/ensure an existing config before applying non-purge updates and repeat-keyword updates. - Expanded Pester coverage to validate behavior when the target config file is missing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/sshdconfig/src/util.rs | Adds seeding helper to create a missing target config from a Windows default source. |
| resources/sshdconfig/src/set.rs | Calls the new seeding helper before reading/modifying config for non-purge and repeat operations. |
| resources/sshdconfig/locales/en-us.toml | Adds new localized messages for seeding and missing-default-source scenarios. |
| resources/sshdconfig/tests/sshdconfig.set.tests.ps1 | Updates/extends set tests for missing-file behavior. |
| resources/sshdconfig/tests/sshdconfigRepeat.tests.ps1 | Adds repeat-keyword test for missing-file behavior. |
| resources/sshdconfig/tests/sshdconfigRepeatList.tests.ps1 | Adds repeat-list test for missing-file behavior. |
| resources/sshdconfig/tests/sshdconfig.get.tests.ps1 | Tightens get tests to ensure missing config doesn’t get created. |
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.
PR Summary
PR Context