mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09: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>
(cherry picked from commit 0306581f1c)
This commit is contained in:
@@ -894,12 +894,8 @@ sftp_status_message parse_status_msg(sftp_message msg)
|
||||
&status->langmsg);
|
||||
|
||||
if (rc != SSH_OK && msg->sftp->version >= 3) {
|
||||
/* These are mandatory from version 3 */
|
||||
SAFE_FREE(status);
|
||||
ssh_set_error(msg->sftp->session, SSH_FATAL,
|
||||
"Invalid SSH_FXP_STATUS message");
|
||||
sftp_set_error(msg->sftp, SSH_FX_FAILURE);
|
||||
return NULL;
|
||||
SSH_LOG(SSH_LOG_WARN,
|
||||
"Invalid SSH_FXP_STATUS message. Missing error message.");
|
||||
}
|
||||
|
||||
if (status->errormsg == NULL)
|
||||
|
||||
Reference in New Issue
Block a user