Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid double escaping of ProxyCommand on Windows #3664

Merged
merged 1 commit into from Aug 24, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Aug 24, 2022

I don't have a Windows setup, but I tested this on Linux with the following:

Binary name:

❯ ls coder*
coder\test\n"

SSH Config:

ProxyCommand "/home/maf/src/coder/coder\test\n\"" --global-config "/home/maf/.config/coderv2" ssh --stdio test

This shows that neither \t, nor \n are interpreted as tab or newline, so \ doesn't seem to have special meaning when inside "", but \" seems necessary to avoid it being interpreted as literal ".

Without \" in the ProxyCommand, we get: zsh: unmatched ".

I tried looking through OpenSSH documentation, but could not find specifics as to what happens inside "", it simply mentions that "" must be used when there is whitespace in the name.

Fixes #2853

@mafredri mafredri self-assigned this Aug 24, 2022
@mafredri mafredri requested a review from a team Aug 24, 2022
@mafredri mafredri merged commit 123fe01 into main Aug 24, 2022
20 checks passed
@mafredri mafredri deleted the mafredri/config-ssh-windows-fix branch Aug 24, 2022
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.

2 participants