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

Wrong path transformation for host running OpenSSH on Windows #194

Open
xdom opened this issue Feb 10, 2017 · 3 comments
Open

Wrong path transformation for host running OpenSSH on Windows #194

xdom opened this issue Feb 10, 2017 · 3 comments

Comments

@xdom
Copy link

xdom commented Feb 10, 2017

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).
@xdom xdom changed the title Wrong path transformation for host running WinSSHD Wrong path transformation for host running OpenSSH on Windows Feb 10, 2017
@vpartington
Copy link
Contributor

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. :-)

@xdom
Copy link
Author

xdom commented Feb 20, 2017

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.

@vpartington
Copy link
Contributor

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. ;-)

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

No branches or pull requests

2 participants