SSH: fix download/upload with -1 exit status #2545
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pwntools Pull Request
Thanks for contributing to Pwntools! Take a moment to look at
CONTRIBUTING.md
to make sure you're familiar with Pwntools development.Please provide a high-level explanation of what this pull request is for.
The
paramiko
recv_exit_status
function returns -1 is no return code is received, this can happen because the ssh server did not send anexit-status
request.The RFC 4254 states this request is recommended but not required, so an SSH Server would be working correctly but the upload and download functions of pwntools would fail.
I'm not sure if you consider this a bug and against which branch you want this targeted.
Testing
Pull Requests that introduce new code should try to add doctests for that code. See
TESTING.md
for more information.Target Branch
Depending on what the PR is for, it needs to target a different branch.
You can always change the branch after you create the PR if it's against the wrong branch.
dev
dev
stable
stable
branchbeta
beta
branch, but notstable
dev
Changelog
After creating your Pull Request, please add and push a commit that updates the changelog for the appropriate branch.
You can look at the existing changelog for examples of how to do this.