-
Notifications
You must be signed in to change notification settings - Fork 778
ProxyCommand incorrectly requires an absolute path #1185
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
Comments
From what I can tell, the upstream code doesn't actually use posix_spawnp(), it uses execv() after a fork(). Regardless, it looks like Win32 fork prepends the OpenSSH directory to the executable string in spawn_child_internal() if the string is not an absolute path which subsequently causes CreateProcess() to not go through the normal PATH environment variable search routine. I imagine this might have been to ensure that an unqualified executable in sshd_config could be launched without worrying about what the working directory might have been sshd was launched. Maybe a better thing to do would be to set the working directory to the OpenSSH at launch via SetCurrentDirectory() and let the CreateProcess() executable resolution code do it's thing or maybe prepend the OpenSSH directory into the beginning of the path which should have the same effect? Thoughts? |
Right, upstream uses Perhaps the right fix is to do the same and run the command line through |
Behavior of current posix_spawn is to support launching ssh from sftp and scp. |
1. fix of issue PowerShell/Win32-OpenSSH#1185 2. add End2End tests
Added support of posix_spawnp. 1. fix of issue PowerShell/Win32-OpenSSH#1185 2. add End2End tests
posix_spawnp is implemented to respect PATH. Relative path should work for ProxyCommand now. |
ProxyCommand requires an executable with an absolute path or a path relative to the ssh.exe installation directory. This is because it uses
posix_spawn
instead ofposix_spawnp
(although the latter is not currently implemented).This seems wrong. OpenSSH on POSIX passes the ProxyCommand to the shell, and the shell looks up the executable in the path.
This breaks the inbox Windows
hvc
tool for connecting to Hyper-V VMs.Expected:
Observed (Linux, relative path):
Observed (Windows, absolute path):
Observed (Windows, relative path):
The text was updated successfully, but these errors were encountered: