xebialabs / overthere

Runs something "Over there"

Home Page:http://www.xebialabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong path transformation for host running OpenSSH on Windows

xdom opened this issue · comments

According to PowerShell/Win32-OpenSSH#62, Windows path C:\some\file.txt should be transformed to /C:/some/file.txt with the colon after the drive letter preserved.
This bug affects a host which is running OpenSSH on Windows platform with connection type set to SshConnectionType.SFTP_WINDOWS, so I suggest either

  1. creating a new SSH connection type for Windows running OpenSSH and new SshSftpConnection subclass which would be the same as SshSftpWinSshdConnection but preserving the colon after the drive letter, or
  2. creating a new SSH connection type for Windows running OpenSSH and patching SshSftpWinSshdConnection class to either preserve or ommit the colon based on connection type option (WinSSHD vs WinOpenSSH).

You'll need the connection type SFTP_CYGWIN if you are running OpenSSH on Windows.

You need SFTP_WINSSHD when you run Bitvise SSH Server.

The difference is indeed in the path transformation. :-)

Please note that when using SFTP_CYGWIN file path is transformed to format /cygdrive/c/some/file.txt by SshSftpCygwinConnection class. This is undesired when OpenSSH on Windows is not running with Cygwin.

Aha, I didn't know that OpenSSH behaved differently when not running under Cygwin.

Overthere has been tested with and developed for two SSH servers on Windows:

  1. Bitvise SSH Server
  2. OpenSSH in Cygwin, or actually Copssh

For the first C:\Some\File.txt needs to be translated to /C/Some/File.txt. And for the second to /cygdrive/c/Some/File.txt.

So I agree with your original idea: implement a new connection type to support OpenSSH on Windows.

Unfortunately, I probably won't find the time to build (and test) that anytime soon. But pull requests are welcome. ;-)