Skip to content

Commit 0f05a23

Browse files
committed
quote ssh include path for paths containing space
1 parent dc2709b commit 0f05a23

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

coman/src/cscs/handlers.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,14 @@ async fn store_ssh_information(
463463
.open(ssh_config_path)?;
464464
let mut content = String::new();
465465
ssh_config.read_to_string(&mut content)?;
466-
if !content.contains(&format!("Include {}", coman_ssh_config_path.clone().display())) {
466+
if !content.contains(&format!("Include \"{}\"", coman_ssh_config_path.clone().display()))
467+
&& !content.contains(&format!("Include {}", coman_ssh_config_path.clone().display()))
468+
// second condition kept for backward compatibility, path was not always quoted
469+
{
467470
let mut writer = BufWriter::new(ssh_config);
468471
write!(
469472
writer,
470-
"\n\n#coman include\nMatch all\nInclude {}",
473+
"\n\n#coman include\nMatch all\nInclude \"{}\"",
471474
coman_ssh_config_path.display()
472475
)?;
473476
}

0 commit comments

Comments
 (0)