From 0306581f1ca2de22236a330aba14b071625b8304 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 3 Sep 2024 10:43:07 +0200 Subject: [PATCH] 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 Reviewed-by: Sahana Prasad --- src/sftp_common.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sftp_common.c b/src/sftp_common.c index b340f9a1..13512b8d 100644 --- a/src/sftp_common.c +++ b/src/sftp_common.c @@ -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)