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

Update to support rename flags in #652 breaks V3 SFTP Protocol and causes errors with AWS SFTP Server #751

Closed
SteveReedMO opened this issue Dec 17, 2021 · 0 comments

Comments

@SteveReedMO
Copy link

The pull request for #652 enables the ability to set rename flags. This was recently rolled into V0.32.0.

I believe this is a SFTP V5+ only feature it should not be enabled for SFTP V3/4 servers that will not support this.

As sshj has a max SFTP version of 3. It's rename packets should have the following structure

byte SSH_FXP_RENAME
uint32 id
string oldpath
string newpath

and not this structure, which is what V0.32.0 is currently sending for any rename

byte SSH_FXP_RENAME
uint32 id
string oldpath
string newpath
uint32 flags

Servers not expecting the extra uint32 flag at the end of the packet may experience issues.

We have witnessed the change in behaviour from V0.31.0 to V0.32.0 using this library with the AWS Transfer Family SFTP Server.

On a file rename we now see the following stacktrace

net.schmizz.sshj.sftp.SFTPException: Timeout expired
at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:33)
at net.schmizz.sshj.sftp.SFTPException$1.chain(SFTPException.java:26)
at net.schmizz.concurrent.Promise.retrieve(Promise.java:139)
net.schmizz.sshj.sftp.SFTPEngine.doRequest(SFTPEngine.java:144)
net.schmizz.sshj.sftp.SFTPEngine.doRequest(SFTPEngine.java:144)
net.schmizz.sshj.sftp.SFTPEngine.remove(SFTPEngine.java:211)
net.schmizz.sshj.sftp.SFTPClient.rm(SFTPClient.java:129)

and this error

ERROR [Timer-Driven Process Thread-10] net.schmizz.concurrent.Promise <<sftp / 13>> woke to: net.schmizz.sshj.sftp.SFTPException: EOF while reading packet

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

No branches or pull requests

1 participant