1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

sftp: Clarify the order of arguments for symlink

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
Jakub Jelen
2023-03-27 21:50:16 +02:00
parent baa18d3712
commit c024280669
2 changed files with 9 additions and 1 deletions

View File

@@ -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",

View File

@@ -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)
{