Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-468: Handle excess data in SFTP read requests #495

Merged
merged 1 commit into from
May 5, 2024

Conversation

tomaswolf
Copy link
Member

Some SFTP servers appear to return sometimes more data than requested. If that happened, it was possible that a downloaded file would be corrupted (size larger than expected, and some duplicated data inside the file).

By default, throw an exception if an SFTP server returns more data than requested. If property SftpModuleProperties.TOLERATE_EXCESS_DATA is set to true on the session or on the channel, discard such excess data and log a warning.

Avoid code duplication; unify SSH_FXP_READ response handling in AbstractSftpClient.

Some SFTP servers appear to return sometimes more data than requested.
If that happened, it was possible that a downloaded file would be
corrupted (size larger than expected, and some duplicated data inside
the file).

By default, throw an exception if an SFTP server returns more data than
requested. If property SftpModuleProperties.TOLERATE_EXCESS_DATA is set
to true on the session or on the channel, discard such excess data and
log a warning.

Avoid code duplication; unify SSH_FXP_READ response handling in
AbstractSftpClient.
@tomaswolf tomaswolf merged commit 6761529 into apache:master May 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant