[Bug 861] Swapped parameters of SSH_FXP_SYMLINK packet of SFTP protocol

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue May 4 17:35:03 EST 2004


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.




More information about the openssh-bugs mailing list