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

Trips on inline comment in SSH config #5498

Open
suvayu opened this issue Jun 1, 2024 · 4 comments · May be fixed by #5779
Open

Trips on inline comment in SSH config #5498

suvayu opened this issue Jun 1, 2024 · 4 comments · May be fixed by #5779
Labels
bug Something isn't working

Comments

@suvayu
Copy link

suvayu commented Jun 1, 2024

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

xfwm4 4.18.0 on Fedora 40

WezTerm version

20240520-135708-b8f94c47

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Trying to connect to my other machine on the home network by choosing "Shell: New Tab (Domain SSH:machine)" causes this error:

Using libssh-rs to connect to [email protected] # 219 on wifi:22
Error: Fatal: failed to set option

⚠️  Process RemoteSshDomain didn't exit cleanly
Exited with code 1.
This message is shown because exit_behavior="CloseOnCleanExit"

The corresponding config in ~/.ssh/config is:

Host    machine
        User            user
        HostName        192.168.1.122 # 219 on wifi

I think it's failing to parse the HostName line. It includes the inline comment as the hostname. When I move the comment to the next line, I can connect.

To Reproduce

Try to connect to a host where the corresponding config has an inline comment in the line with HostName

Host    machine
        User            user
        HostName        192.168.1.122 # 219 on wifi

Configuration

no config

Expected Behavior

I can connect to the remote host.

Logs

No response

Anything else?

No response

@suvayu suvayu added the bug Something isn't working label Jun 1, 2024
hdonnay added a commit to hdonnay/wezterm that referenced this issue Jul 3, 2024
Looking at the openssh-portable code, it seems that inline comments are
only handled specially on `Match` and `ProxyJump` statements. This
change adds inline comment handling.

Closes: wez#5498
See-also: https://github.com/openssh/openssh-portable/blob/ee6b9e661633fcefd29dba0c811cecbc4d027f6f/readconf.c#L652
Signed-off-by: Hank Donnay <[email protected]>
@hdonnay
Copy link

hdonnay commented Jul 9, 2024

I wrote up a patch that seems to match OpenSSH's behavior, which doesn't allow inline comments on all lines.

@suvayu
Copy link
Author

suvayu commented Jul 12, 2024

If you have a branch with the patch, I'm happy to test it.

@hdonnay
Copy link

hdonnay commented Jul 12, 2024

You should be able to get to it from the linked PR.

@suvayu
Copy link
Author

suvayu commented Jul 12, 2024

I compiled that branch with cargo build, and started wezterm with cargo run --bin wezterm, and I still see the same behaviour. How can I provide more information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants