diff --git a/src/sftp.c b/src/sftp.c index ed353377..983d6831 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -2812,7 +2812,10 @@ int sftp_symlink(sftp_session sftp, const char *target, const char *dest) id = sftp_get_new_id(sftp); - /* TODO check for version number if they ever fix it. */ + /* The OpenSSH sftp server has order of the arguments reversed, see the + * section "4.1 sftp: Reversal of arguments to SSH_FXP_SYMLINK' in + * https://github.com/openssh/openssh-portable/blob/master/PROTOCOL + * for more information */ if (ssh_get_openssh_version(sftp->session)) { rc = ssh_buffer_pack(buffer, "dss", diff --git a/src/sftpserver.c b/src/sftpserver.c index 8d5ff665..57983f57 100644 --- a/src/sftpserver.c +++ b/src/sftpserver.c @@ -1462,6 +1462,11 @@ process_readlink(sftp_client_message client_msg) return ret; } +/* Note, that this function is using reversed order of the arguments than the + * OpenSSH sftp server as they have the arguments switched. See + * section "4.1 sftp: Reversal of arguments to SSH_FXP_SYMLINK' in + * https://github.com/openssh/openssh-portable/blob/master/PROTOCOL + * for more information */ static int process_symlink(sftp_client_message client_msg) {