bugzilla-daemon at mindrot.org
2004-May-04 07:35 UTC
[Bug 861] Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol
http://bugzilla.mindrot.org/show_bug.cgi?id=861 Summary: Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol Product: Portable OpenSSH Version: -current Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: sftp-server AssignedTo: openssh-bugs at mindrot.org ReportedBy: opensshbugzilla at prikryl.cz Hello, I'm developer of WinSCP (SCP/SFTP client for Windows). I have just realised that my client is probably sending parameters linkpath and targetpath of SFTP SSH_FXP_SYMLINK packet in incorrect order. What has surprised me is that despite this, it works fine with all OpenSSH SFTP servers. Well otherwise I would have noticed earlier :-) This made me believe that OpenSSH SFTP server has the same bug. Ssh.com SFTP server obviously adheres to the standards, so with it my client cannot create the links. Can you confirm this? http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt The SSH_FXP_SYMLINK request will create a symbolic link on the server. It is of the following format uint32 id string linkpath string targetpath The latest (CVS) sftp-server.c: 873: oldpath = get_string(NULL); 874: newpath = get_string(NULL); 875: TRACE("symlink id %u old %s new %s", id, oldpath, newpath); 876: /* this will fail if 'newpath' exists */ 877: ret = symlink(oldpath, newpath); The same bug is obviously even in OpenSSH SFTP client: The latest (CVS) sftp-client.c: 647: id = conn->msg_id++; 648: buffer_put_char(&msg, SSH2_FXP_SYMLINK); 649: buffer_put_int(&msg, id); 650: buffer_put_cstring(&msg, oldpath); 651: buffer_put_cstring(&msg, newpath); Have a nice day. Martin Prikryl http://www.prikryl.cz/ http://winscp.sourceforge.net/ ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-May-12 02:40 UTC
[Bug 861] Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol
http://bugzilla.mindrot.org/show_bug.cgi?id=861 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Additional Comments From dtucker at zip.com.au 2004-05-12 12:40 ------- Yep, that looks like a bug to me. I suspect the confusion is due to SSH_FXP_SYMLINK having its arguments in the opposite order to the equivalent Unix "ln" command, whereas other (eg FXP_RENAME) are the same as their equivalents. The next question is what to do about it, and when? AFAIK, sftp doesn't know what SSH server is on the other end, except for the SFTP protocol version (it just runs "ssh -s host sftp"). Maybe fix it next time the protocol version supported is bumped? ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-May-12 07:52 UTC
[Bug 861] Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol
http://bugzilla.mindrot.org/show_bug.cgi?id=861 ------- Additional Comments From opensshbugzilla at prikryl.cz 2004-05-12 17:52 ------- Are there any plans to support newer version of SFTP? You support version 3, while there is version 5 draft published already. BTW: version 5 has mechanism to detect version of SFTP server software (not SFTP protocol version). Possible (maybe dirty) workaround would be to utilize SFTP extension to let the client know if the bug is fixed already. But it would not solve problem when other vendors's client connects to your server. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.