mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-08 03:42:12 +03:00
sftp: Do not fail if the status message does not contain error message
Some SFTP servers (Cisco) do not implement the v3 protocol correctly and do not send the mandatory part of the status message. This falls back to the v2 behavior when the error message and language tag are not provided. Fixes: #272 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
@@ -894,12 +894,8 @@ sftp_status_message parse_status_msg(sftp_message msg)
|
|||||||
&status->langmsg);
|
&status->langmsg);
|
||||||
|
|
||||||
if (rc != SSH_OK && msg->sftp->version >= 3) {
|
if (rc != SSH_OK && msg->sftp->version >= 3) {
|
||||||
/* These are mandatory from version 3 */
|
SSH_LOG(SSH_LOG_WARN,
|
||||||
SAFE_FREE(status);
|
"Invalid SSH_FXP_STATUS message. Missing error message.");
|
||||||
ssh_set_error(msg->sftp->session, SSH_FATAL,
|
|
||||||
"Invalid SSH_FXP_STATUS message");
|
|
||||||
sftp_set_error(msg->sftp, SSH_FX_FAILURE);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status->errormsg == NULL)
|
if (status->errormsg == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user