Skip to content

fix: Avoid double escaping of ProxyCommand on Windows #3664

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

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

mafredri
Copy link
Member

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 August 24, 2022 14:56
@mafredri mafredri merged commit 123fe01 into main Aug 24, 2022
@mafredri mafredri deleted the mafredri/config-ssh-windows-fix branch August 24, 2022 16:12
mafredri added a commit that referenced this pull request Aug 26, 2022
mafredri added a commit that referenced this pull request Aug 26, 2022
mafredri added a commit that referenced this pull request Aug 30, 2022
This change takes better into account how OpenSSH executes
`ProxyCommand`s and applies quoting accordingly.

This supercedes #3664, which was reverted.

Fixes #2853
mafredri added a commit that referenced this pull request Aug 30, 2022
* fix: Use smarter quoting for ProxyCommand in config-ssh

This change takes better into account how OpenSSH executes
`ProxyCommand`s and applies quoting accordingly.

This supercedes #3664, which was reverted.

Fixes #2853

* fix: Ensure `~/.ssh` directory exists
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.

Windows: ssh coder.workspace not working after running coder config-ssh
2 participants