Skip to content

Commit 509f6eb

Browse files
committed
fix error message
1 parent 8cd3559 commit 509f6eb

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

resources/sshdconfig/locales/en-us.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ cleanupFailed = "Failed to clean up temporary file %{path}: %{error}"
101101
getIgnoresInputFilters = "get command does not support filtering based on input settings, provided input will be ignored"
102102
seededConfigFromDefault = "Seeded missing sshd_config from '%{source}' to '%{target}'"
103103
sshdConfigDefaultNotFound = "sshd_config file does not exist and no default source could be found. Checked: %{paths}"
104+
sshdConfigNotFoundNonWindows = "sshd_config file does not exist. Start sshd once to initialize the configuration file, then retry."
104105
sshdConfigReadFailed = "failed to read sshd_config at path: '%{path}'"
105106
sshdElevation = "elevated security context required"
106107
tempFileCreated = "temporary file created at: %{path}"

resources/sshdconfig/src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ pub fn ensure_sshd_config_exists(input: Option<PathBuf>) -> Result<PathBuf, Sshd
131131
}
132132

133133
if !cfg!(windows) {
134-
return Err(SshdConfigError::InvalidInput(
135-
t!("util.sshdConfigDefaultNotFound", paths = "Windows seeding is only supported on Windows hosts").to_string()
134+
return Err(SshdConfigError::FileNotFound(
135+
t!("util.sshdConfigNotFoundNonWindows").to_string()
136136
));
137137
}
138138

@@ -171,7 +171,7 @@ pub fn invoke_sshd_config_validation(args: Option<SshdCommandArgs>) -> Result<St
171171

172172
if let Some(args) = args {
173173
if let Some(filepath) = args.filepath {
174-
let filepath = get_default_sshd_config_path(Some(filepath))?; if !filepath.exists() {
174+
if !filepath.exists() {
175175
return Err(SshdConfigError::FileNotFound(filepath.display().to_string()));
176176
}
177177
command.arg("-f").arg(&filepath);

0 commit comments

Comments
 (0)